From bb7833d1beb178c6736b498400cf05790b591048 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 15 Apr 2025 07:15:25 -0700 Subject: Revert "fix(util): improve wildcard escaping" #3729 This reverts commit e39da6a820d2a700904117d29f0dd476d64262cf. --- lua/lspconfig/util.lua | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'lua/lspconfig') diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index d23e47c2..b99f8555 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -93,14 +93,7 @@ function M.search_ancestors(startpath, func) end local function escape_wildcards(path) - -- Escape all potentially problematic special characters - -- Covers: - -- - Wildcards and pattern matching: [ ] ? * $ ( ) ^ % . + - ~ - -- - Escape character: \ - -- - Shell special characters: ` ' " ; | & < > - -- - Whitespace: %s (spaces, tabs, etc.) - -- The gsub function replaces any matches with the same character preceded by a backslash - return path:gsub('([' .. vim.pesc('[]?*$()^%.+-~') .. '\\`\'";|&<>%s])', '\\%1') + return path:gsub('([%[%]%?%*])', '\\%1') end function M.root_pattern(...) -- cgit v1.2.3-70-g09d2