Support fixing require statements after moving a file
Really annoying to go through all the code and update this. This would be a cool addition.
Note that what we could implement inside NodeRequirer would be fairly limited without being too complex.
The ideal would be to have a node based cli command that can move files and reformat references. ;) And it looks like node-mv already does that.
But here are some extra ideas we can do:
Option A) Allow Ctrl+Shift+I to discover when the cursor is placed over an existing require(...), use part of its value to pre-fill the quick panel, and make sure that we only update the require(...).
Option B) Implement Node Move / Node Rename sidebar context menu items (next to the ones that SideBarEnhancements have) that simply reformats the relative requires for the current file.
Option C) Implement Node Move / Node Rename sidebar context menu items that use node-mv when it's installed.
I'm in favour of A and one of B or C, with caveats. B is simple but doesn't solve broken references from other files. C should do proper moves, however if the user has unsaved buffers for files that are modified those will conflict.
An alternate idea might be to intercept SideBarEnhancements' side_bar_rename and side_bar_move commands when in a node based project, re-implements the text input, then pops up a "Would you like to reformat references using node-mv?" question to decide whether to call node-mv or pass the rename/move back to SideBarEnhancements.