Xcode copies files symlinked to UserData

Originator:keithbsmiley
Number:rdar://42206958 Date Originated:14-Jul-2018 04:16 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 10.0 beta 3 (10L201y)
Classification:Other Bug Reproducible:Always
 
Summary:
If you symlink your colorscheme file to ~/Library/Developer/Xcode/UserData/FontAndColorThemes, and then change it in the Xcode UI, Xcode will resolve the symlink, remove it, and copy the file directly instead of editing the file that was symlinked. Having Xcode edit the file directly would be very nice if you want version your theme with git.

Steps to Reproduce:
1. In Xcode's Fonts & Colors preferences, duplicate a colorscheme
2. Move it from `~/Library/Developer/Xcode/UserData/FontAndColorThemes` to your Desktop
3. Quit Xcode
4. Symlink it back with `ln -s ~/Desktop/whatever.xccolortheme ~/Library/Developer/Xcode/UserData/FontAndColorThemes`
5. Re-open Xcode
6. In the Fonts & Colors preferences, change the font size in your theme
7. Quit Xcode
8. Run `ls -la ~/Library/Developer/Xcode/UserData/FontAndColorThemes`

Expected Results:
The `whatever.xccolortheme` in `~/Library/Developer/Xcode/UserData/FontAndColorThemes` is a symlink to the file on your desktop

Actual Results:
Xcode has removed the symlink, and copied the file from your desktop

Version:
Xcode 10.0 beta 3 (10L201y)

Notes:
This also happens with custom `idekeybindings` files in `~/Library/Developer/Xcode/UserData/KeyBindings`

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!