fix(lsp_rename): handle absolute path glob filters (#279)
This commit is contained in:
parent
e71b6caa95
commit
ec24334471
1 changed files with 2 additions and 6 deletions
|
|
@ -84,12 +84,8 @@ local function get_matching_paths(client, filters, paths)
|
||||||
local function match_any_pattern(workspace, path)
|
local function match_any_pattern(workspace, path)
|
||||||
local relative_path = path:sub(workspace:len() + 2)
|
local relative_path = path:sub(workspace:len() + 2)
|
||||||
for _, match_fn in ipairs(match_fns) do
|
for _, match_fn in ipairs(match_fns) do
|
||||||
if match_fn(relative_path) then
|
-- The glob pattern might be relative to workspace OR absolute
|
||||||
return true
|
if match_fn(relative_path) or match_fn(path) then
|
||||||
end
|
|
||||||
-- nvim 0.9 doesn't have full glob support, so we need to check the full path as well as the
|
|
||||||
-- relative path because `**/*.ts` won't match `foo.ts`
|
|
||||||
if vim.fn.has("nvim-0.10") == 0 and match_fn(path) then
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue