Skip to content

Commit 8bb2fac

Browse files
authored
fix(configs): remove sanitize_cmd #3778
Problem: exepath is slow on WSL/Windows. Solution: Remove sanitize_cmd: absolute paths are nice, but not necessary.
1 parent fa26625 commit 8bb2fac

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

lua/lspconfig/configs.lua

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,6 @@ local configs = {}
2424
--- @field root_dir? string|fun(filename: string, bufnr: number)
2525
--- @field commands? table<string, lspconfig.Config.command>
2626

27-
--- @param cmd any
28-
local function sanitize_cmd(cmd)
29-
if cmd and type(cmd) == 'table' and not vim.tbl_isempty(cmd) then
30-
local original = cmd[1]
31-
cmd[1] = vim.fn.exepath(cmd[1])
32-
if #cmd[1] == 0 then
33-
cmd[1] = original
34-
end
35-
end
36-
end
37-
3827
---@param t table
3928
---@param config_name string
4029
---@param config_def table Config definition read from `lspconfig.configs.<name>`.
@@ -64,8 +53,6 @@ function configs.__newindex(t, config_name, config_def)
6453

6554
local config = tbl_deep_extend('keep', user_config, default_config)
6655

67-
sanitize_cmd(config.cmd)
68-
6956
if util.on_setup then
7057
pcall(util.on_setup, config, user_config)
7158
end

0 commit comments

Comments
 (0)