First, in bash:
This should replace all occurrences in my source files. A couple warnings before you do this. This has the potential to do a lot of damage if something goes wrong. So commit to your version control system first. That way, if anything goes wrong, you can just revert to the latest checked in version. Secondly, this is going to cause you problems if you have any unsaved changes in any of your Emacs buffers. So issue a M-x s to Emacs first to save any outstanding changes.find */src -name *.scala -exec sed -i 's/BeezleBopple/BoppleBeezle/g' {} \;
One really nice thing about Scala is that everything still works if my class BoppleBeezle is defined in a file named BeezleBopple.scala. So at this point, I can switch over to the window where I am running continuous compilation via sbt, and I should be able to see things compiling (and maybe tesing) successfully. Now I can rename the source file, something like this for me:
Again, I switch over to my sbt window and see that everything still compiles.svn mv path/to/BeezleBopple.scala path/to/BoppleBeezle.scala
One last problem. I potentially have a whole slew of Emacs buffers open that are now out of date. I want to tell Emacs to reload them all. There are various discussions of different ways to do this, including this Stack Overflow post. I ended up using the global-auto-revert-mode suggestion, which is explained in detail in the Emacs manual. I don't want this setting on all the time, so I run M-x global-auto-revert-mode once to update all my buffers, and run the same command again to turn it off.
Easy! Okay, it's slightly more work than the same thing in Eclipse, but my hands never left the keyboard for the mouse.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.