Two questions: Duplicating Classes and Auto-terminating Lines with a Semicolon

Hello, I'm new to AppCode and there are two things I cannot figure out how to do with AppCode that I'd liket to:

Duplicate a class. Example, I have a class, "ClassA" that I'd like to duplicate with my Xcode project and have renamed, "ClassB". Traditionally, I would duplicate the .h and .m in the Finder, drag them into the Xcode project, and rename instances of "ClassA" to "ClassB". Is this possible to automate in AppCode? I'm not interesed in make subclasses, a common superclass, etc. I need to duplicate class so I can measure the side-by-side progress of research code as it's developed.

The second thing that I think should be possible in AppCode, but can't find the function for, is found it the app TextMate: In TextMate, I can type command-shift-return wherever my cursor is on a line, and the cursor will jump to the end of the line, add a semi-colon if one is not present, then carriage-return to the next line.


Comment actions Permalink


To clone a file select it in the 'Xcode Project/Files View' and press Shift+F5 ('Clone'). After cloning, you will be able to add it to the project either from 'Files View' or with 'Xcode Project View->Add->Files...'.
Here are a few related issues:

To complete a line, use Command+Shift+Enter shortcut ('Complete Sentence'), it work for expression and statements as well, e.g. try using it on 'while(1)' line.
There is also Shift+Enter shortcut ('Smart New Line') that moves caret to the next line regardless the cursor's offset in the current line.

You can find variaous helpful shortcuts in 'Help->Default Keymap Reference'.

Comment actions Permalink


(And very embarrassing that I did not try TextMate's keyboard shortcut... :)

Comment actions Permalink

Great!  I've been looking for this!

This command does not show up in the refactor context menu or the Refactor main menu, or the refactor this menu.  It seems like it should, then it would be more discoverable.
Also, clone file doesn't seem to rename the class for the file.

Anton,  I read both issues you mention, but it isn't clear to me if they cover the above comments.

Comment actions Permalink

David, here is a bug report that covers the problem with cloning a class:
It states that, when cloning a class, it should make copies of m and h file and give the class a new name.


Please sign in to leave a comment.