nvim-lsp-file-operations icon indicating copy to clipboard operation
nvim-lsp-file-operations copied to clipboard

It doesn't work when moving the file

Open vricop opened this issue 2 years ago • 7 comments

It works great when you rename a file, but renaming a folder in the path or moving a file to a different location won't.

vricop avatar Apr 08 '23 11:04 vricop

Hey, @vricop ! Can you give a bit more context, please. What language server are you using? Did you try to check debug logs?

My best guess is that your language server doesn't support folder rename yet. I saw only a few that do support it. If that is the case you can try to create as issue there

antosha417 avatar Apr 10 '23 15:04 antosha417

Hey, @vricop ! Can you give a bit more context, please. What language server are you using? Did you try to check debug logs?

My best guess is that your language server doesn't support folder rename yet. I saw only a few that do support it. If that is the case you can try to create as issue there

Sorry, my bad, I'll find some time in the weekend to explain it better.

vricop avatar Apr 14 '23 21:04 vricop

I hit the same thing. Makes sense that this is something that slipped through the cracks for tsserver. It's not so bad but it'd be really nice to have. It means I gotta be a bit more thoughtful naming my directory structures, and will make me tend to use somewhat fewer directories. I'm loving the ease with which individual files can be renamed with this thing though. I had issues getting it working for neo-tree, but nvim-tree is solid at handling the events.

unphased avatar Dec 08 '23 08:12 unphased

Hey, @vricop ! Can you give a bit more context, please. What language server are you using? Did you try to check debug logs? My best guess is that your language server doesn't support folder rename yet. I saw only a few that do support it. If that is the case you can try to create as issue there

Sorry, my bad, I'll find some time in the weekend to explain it better.

I'm using Typescript. When moving a file/folder to a different location it won't update imports. That's what I meant.

vricop avatar Dec 08 '23 22:12 vricop

For me moving (renaming) a file across the repo works, but moving a whole folder doesn't (like your OP states)

unphased avatar Dec 09 '23 05:12 unphased

I'm experiencing the same problem, using basedpyright with both neo-tree.nvim and triptych.nvim. Renaming files works well (r action in neo-tree.nvim), but moving them (x + p action in neo-tree.nvim) does not trigger the correct import fixes.

JakobGM avatar Jan 12 '25 19:01 JakobGM

Maybe try manually reloading the plugin with :Lazy reload nvim-lsp-file-operations? See #44.

sghng avatar Mar 10 '25 06:03 sghng