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.

Thanks,
John

4 comments
Comment actions Permalink

John,

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:
http://youtrack.jetbrains.com/issue/OC-3432
http://youtrack.jetbrains.com/issue/OC-3433.

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'.

0
Comment actions Permalink

Thanks!

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

0
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.

0
Comment actions Permalink

David, here is a bug report that covers the problem with cloning a class: http://youtrack.jetbrains.com/issue/OC-3432.
It states that, when cloning a class, it should make copies of m and h file and give the class a new name.

0

Please sign in to leave a comment.