A VSCode plugin which allows you to move code structures (such as functions and classes) up and down with keyboard shortcuts.
Use the shortcuts Ctrl+Shift+Up or Ctrl+Shift+Down (Cmd+Shift+Up or Cmd+Shift+Down on a Mac) to move the structure under the cursor up or down.
This should work reasonably well in most languages for which VSCode has a good plugin. If a language plugin supports selection widening (Ctrl+Shift+Right) and also supports the "Outline" view (in the "Explorer" panel on the left) then Structural Motion has a good chance of working.
- Multiple cursors are not supported
- Moving selected text is not supported
- Indentation based languages (such as Python) behave less robustly because the line on which a class and it's last method end are the same, so Structural-Motion can't make a good decision about what to move
- Line breaks in strange places can confuse Structural-Motion
- Whitespace at the end of lines can confuse Structural-Motion
- Moving structures past method chains doesn't work well