Allow creating new file(s) from an Xcode Source Editor Extension

Number:rdar://35194855 Date Originated:26/10/2017
Status: Resolved:
Product:Xcode Product Version:9
Classification:Suggestion Reproducible:
I'm the author of "Swiftify for Xcode" Extension:

Obviously, the Xcode extension that helps to convert Objective-C code to Swift needs to create an output file (i.e. MyClass.swift) when converting an input file (i.e. MyClass.m).
Currently, when using either "Convert File to Swift" or "Convert Selection to Swift" commands, "Swiftify for Xcode" replaces contents of the currently edited file, which have to be manually moved to another source file by the user.

Expected behavior: provide an API for Xcode Source Editor extensions to create a file with the same base file name as the edited file but a different extension.
The similar feature is available when developing Finder extensions, and plans well with the App Sandboxing.

For example, if "MyViewController.h" or "MyViewController.m" is opened in Xcode, provide an API to create a file with the same base file name but a different extension, i.e. "MyViewController.swift".


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at 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!