Closed faergeek closed 4 months ago
So something is wrong with vim.glob.to_lpeg
. All other extensions match except jsx and tsx:
vim.glob.to_lpeg('**/*.{ts,js,jsx,tsx,mjs,mts,cjs,cts}'):match('src/add.jsx')
vim.glob.to_lpeg('**/*.{ts,js,jsx,tsx,mjs,mts,cjs,cts}'):match('src/add.tsx')
Reported here https://github.com/neovim/neovim/issues/28931
Well I don't have a proper fix, but I put in a hack that works in this case. It probably won't cause more problems than it solves.
Thanks for the thorough repro! Made it very easy to test the fix.
Awesome! Thank you for this great plugin which I use every day :+1:
Did you check the docs and existing issues?
Neovim version (nvim -v)
0.10.0
Operating system/version
Arch Linux
Describe the bug
LSP renaming stopped working for me in neovim 0.10.0. I checked in v0.9.5, it works fine.
First I used
git bisect
in oil repo to figure out where it stopped working. Neovim is locally built from 0.10.0 git tag. At this commit it still works https://github.com/stevearc/oil.nvim/commit/1fce168881248e8310ebff2b4417db24ab7c175a, then it starts erroring out withoil.nvim/lua/oil/lsp_helpers.lua:24: attempt to call field '_match'
on this commit https://github.com/stevearc/oil.nvim/commit/24027ed8d7f3ee5c38cfd713915e2e16d89e79b3. After https://github.com/stevearc/oil.nvim/commit/250e0af7a54d750792be8b1d6165b76b6603a867 (where._match
usage was removed) it doesn't error, but renaming also doesn't work.I also used
git bisect
on neovim repo to figure out at which point it stopped working. oil.nvim is at https://github.com/stevearc/oil.nvim/commit/259b1fbc84734bfb74225b2c2f408dd7ed9cf474 locally. Turns out this is the first commit where it stopped working https://github.com/neovim/neovim/commit/92204b06e7365cf4c68e6ea8258dce801f0a5df9.While preparing reproduction repo I noticed that it works fine when renaming
.ts
files, but not when renaming.tsx
files. So it might be all related to glob handling I guess.What is the severity of this bug?
breaking (some functionality is broken)
Steps To Reproduce
Not sure how else to easily reproduce it. Node and npm are required for this.
npm install
nvim -u init.lua -o src/root.ts src/add.tsx src/subtract.ts
add.tsx
buffer,:Oil
, rename file. Import inroot.ts
is not updated.subtract.ts
buffer,:Oil
, rename file. Import inroot.ts
is updated properly.Expected Behavior
File renaming with LSP works in both cases.
Directory structure
No response
Repro
Did you check the bug with a clean config?
nvim -u repro.lua
using the repro.lua file above.