Module
mini.files
Description
On Windows, mini.files appears to use C://... as an internal normalized path form. That can be useful internally, but the same path currently reaches the LSP file-operation flow and breaks per-client file-operation filtering.
In the current implementation, rename actions eventually call vim.uri_from_fname(d.from) / vim.uri_from_fname(d.to) inside the LSP hook. If d.from / d.to are Windows paths in mini.files' internal C://Users/... form, Neovim produces URIs like file:///C://Users/....
Later, mini.files applies each client's workspace.fileOperations.*.filters by converting the URI back with vim.uri_to_fname(...):gsub('\\', '/'). On Windows this remains C://Users/..., which does not match lua_ls' normal filter glob such as C:/Users/Miku/AppData/Local/nvim/**.
As a result, mini.files sends workspace/didRenameFiles with files = {}. lua_ls receives an empty rename list, so its require-path update logic exits early and the expected "Do you want to modify the require path?" prompt never appears.
Minimal reproduction / evidence
Environment:
- Windows
- Neovim 0.12.3
- mini.nvim main at
1345d191bb3da9c7b0e977f4387c5761f9bff68d
- lua-language-server attached to a Lua project rooted at
C:/Users/Miku/AppData/Local/nvim
Observed from MiniFilesActionRename event data:
from = "C://Users/Miku/AppData/Local/nvim/lua/ray/utils/windows.lua"
to = "C://Users/Miku/AppData/Local/nvim/lua/ray/utils/jindows.lua"
Local checks inside Neovim:
local p = "C://Users/Miku/AppData/Local/nvim/lua/ray/utils/windows.lua"
print(vim.fs.normalize(p))
-- C:/Users/Miku/AppData/Local/nvim/lua/ray/utils/windows.lua
print(vim.uri_from_fname(p))
-- file:///C://Users/Miku/AppData/Local/nvim/lua/ray/utils/windows.lua
print((vim.uri_to_fname(vim.uri_from_fname(p)):gsub('\\', '/')))
-- C://Users/Miku/AppData/Local/nvim/lua/ray/utils/windows.lua
Filter match check:
local glob = "C:/Users/Miku/AppData/Local/nvim/**"
local lp = vim.glob.to_lpeg(glob)
print(lp:match("C:/Users/Miku/AppData/Local/nvim/lua/ray/utils/windows.lua") ~= nil)
-- true
print(lp:match("C://Users/Miku/AppData/Local/nvim/lua/ray/utils/windows.lua") ~= nil)
-- false
A control workaround using normalized paths triggers lua_ls correctly:
Snacks.rename.on_rename_file(vim.fs.normalize(event.data.from), vim.fs.normalize(event.data.to))
That causes lua_ls to show the expected Modify Require Path prompt.
Expected behavior
mini.files may keep C://... internally if needed, but paths should be normalized/canonicalized before crossing the LSP boundary. In particular, LSP URI construction and file-operation filter matching should use canonical Windows paths like C:/Users/..., not mini.files' internal C://Users/... representation.
Related context
Module
mini.files
Description
On Windows,
mini.filesappears to useC://...as an internal normalized path form. That can be useful internally, but the same path currently reaches the LSP file-operation flow and breaks per-client file-operation filtering.In the current implementation, rename actions eventually call
vim.uri_from_fname(d.from)/vim.uri_from_fname(d.to)inside the LSP hook. Ifd.from/d.toare Windows paths in mini.files' internalC://Users/...form, Neovim produces URIs likefile:///C://Users/....Later,
mini.filesapplies each client'sworkspace.fileOperations.*.filtersby converting the URI back withvim.uri_to_fname(...):gsub('\\', '/'). On Windows this remainsC://Users/..., which does not match lua_ls' normal filter glob such asC:/Users/Miku/AppData/Local/nvim/**.As a result,
mini.filessendsworkspace/didRenameFileswithfiles = {}. lua_ls receives an empty rename list, so its require-path update logic exits early and the expected "Do you want to modify the require path?" prompt never appears.Minimal reproduction / evidence
Environment:
1345d191bb3da9c7b0e977f4387c5761f9bff68dC:/Users/Miku/AppData/Local/nvimObserved from
MiniFilesActionRenameevent data:Local checks inside Neovim:
Filter match check:
A control workaround using normalized paths triggers lua_ls correctly:
That causes lua_ls to show the expected Modify Require Path prompt.
Expected behavior
mini.filesmay keepC://...internally if needed, but paths should be normalized/canonicalized before crossing the LSP boundary. In particular, LSP URI construction and file-operation filter matching should use canonical Windows paths likeC:/Users/..., not mini.files' internalC://Users/...representation.Related context
C://internal path form with LSP file-operation filtering producing emptyfilesarrays.