Xcode 10.1: Xcode does not respect project indentation width if assistant editor opens a "Referenced File" from report navigator

Originator:akaralar
Number:rdar://46004752 Date Originated:13 November 2018
Status:OPEN Resolved:
Product:Xcode Product Version:10.1
Classification:UI/Usability Bug Reproducible:YES
 
Summary:
When there are build errors, assistant editor can be used to navigate to the file by opening the report navigator, selecting an issue and making sure “Referenced Files” is selected in the assistant editor drop down. However if the project indentation width and the Xcode setting for the indentation width are different, the file adheres to the Xcode setting, not the project setting. Xcode while editing normally adheres to the project setting. This only happens when the assistant editor is open and showing some “Referenced Files” from the main editor.

Steps to Reproduce:
1- Change Xcode indentation and tab width to use 2 spaces (http://take.ms/Ipt6Y)
2- Open a project, select the project from the Project Navigator, show the Inspector, select File Inspector, and in the Text Settings block choose to have 4 spaces for both tab and indent. (http://take.ms/Gqasa)
3- Plant an error (or warning) in the project and build it.
4- Open report navigator after build finishes or fails, select the latest build, select an issue and select “Referenced Files” in the assistant editor (http://take.ms/j5ad1)
5- Now edit code in the assistant editor and press ctrl + I (or choose Editor -> Structure -> Re-Indent from the menubar) to reindent the code

Expected Results:
The code should indent to 4 spaces as per the project setting.

Actual Results:
The code indents to 2 spaces as per the Xcode preferences setting, even after you choose to manually open another file instead of using “Referenced Files” in the assistant editor. 

Regression:
None

Notes:
The code indents properly to the project settings if the file is opened in the main editor and assistant editor is used manually.

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!