fix(windows): convert posix paths before matching LSP watch globs (#374)

This commit is contained in:
Steven Arcangeli 2024-05-14 22:55:18 -06:00 committed by GitHub
parent 3283deec96
commit f630887cd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View file

@ -65,6 +65,12 @@ local function get_matching_paths(client, filters, paths)
if ignore_case then
glob = glob:lower()
end
-- Some language servers use forward slashes as path separators on Windows (LuaLS)
if fs.is_windows then
glob = glob:gsub("/", "\\")
end
---@type nil|vim.lpeg.Pattern
local glob_pattern = vim.glob and vim.glob.to_lpeg and vim.glob.to_lpeg(glob)
local matches = pattern.matches