Osmose / advanced-open-file

Open files and folders in Atom easily.
https://atom.io/packages/advanced-open-file
Other
119 stars 20 forks source link

(feat) New file with selection extracted #134

Closed DJTB closed 7 years ago

DJTB commented 7 years ago

Hey Osmose, really appreciate this package and all your hard work on it. Recently I was looking for something to help with refactoring and couldn't find anything on apm for my use case.

It seems like it might be better as a feature for advanced-open-file rather than a standalone package that would have to replicate a lot of the functionality.

In brief, it would be fantastic to have a shortcut that opens up the new file dialog as usual, however when the new file is created, any selected text is cut from the file that was already active and pasted into the new file.

It may seem like a minor productivity increase, but I just had to extract 50 odd methods into a new directory structure - advanced open file helped a lot in quickly typing core/utils/newfile.js and having the folders created automagically, but having the selection content swap into the new file would have been a dream.

Not exactly a dealbreaker if you don't think this is a valid addition, but an idea for a new feature nonetheless.

Osmose commented 7 years ago

Thanks for the idea (and for using the package)! I don't think it's a good match for advanced-open-file though. Depending on the structure you're starting from, this seems better suited to a small script for splitting up your functions into multiple files, and then moving those files into new directories. That's heavily dependent on the nature of the refactor, though.

Closing this since I probably wouldn't accept a patch for it. But thanks again!