Xcode text editor should provide a "Preserve Case" replacement option

Originator:kristopherdjohnson
Number:rdar://16143864 Date Originated:23-Feb-2014 02:14 PM
Status:Open Resolved:
Product:Developer Tools Product Version:5.0.2
Classification:Enhancement Reproducible:N/A
 
Summary:
In Objective-C development, it is common to have a set of identifiers that contain the same words but different cases. For example, a class might contain this:

- (Foo *)foo { return self._foo; }
- (void)setFoo:(Foo *)newFoo { self._foo = newFoo; }

If one wants to change this, or copy-paste-and-replace to create similar methods for a different word, one has to perform two separate search-and-replace operations. For example, to change the above from foo/setFoo to bar/setBar, one to first replace "foo" with "bar" and then replace "Foo" with "Bar". And a third operation may be needed if there is also a need to replace "FOO" with "BAR".

For such situations, it would be helpful if the Xcode find/replace function offered an option to try to match the case when replacing. So, rather than requiring three separate find-and-replace operations, the editor would be smart enough to try to match the case pattern.

Such functionality already exists in Emacs (see http://www.gnu.org/software/emacs/manual/html_node/emacs/Replacement-and-Case.html) and in Sublime Text (the "Preserve Case" option).

Steps to Reproduce:


Expected Results:


Actual Results:


Version:
Xcode 5.0.2/OS X 10.9.1

Notes:


Configuration:


Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!