We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4bebe2f commit 9ce04e1Copy full SHA for 9ce04e1
1 file changed
lua/mini/files.lua
@@ -2809,7 +2809,14 @@ H.lsp_fs_hook = function(method, params)
2809
if filter.scheme then
2810
table.insert(matching_functions, function(uri) return uri:find('^' .. filter.scheme .. ':') ~= nil end)
2811
end
2812
- -- TODO(TheLeoP): add matching_function for `FileOperationPatternKind` ('file' or 'directory')
+ if filter.pattern.matches then
2813
+ table.insert(matching_functions, function(uri)
2814
+ local path = vim.uri_to_fname(uri)
2815
+ local type = H.fs_get_type(path)
2816
+ if filter.pattern.matches == 'folder' then return type == 'directory' end
2817
+ if filter.pattern.matches == 'file' then return type == 'file' end
2818
+ end)
2819
+ end
2820
2821
2822
local filtered_params = {
0 commit comments