Xcode should auto-import headers for any class used

Originator:carpeaqua
Number:rdar://7673765 Date Originated:February 21, 2010
Status:Open Resolved:
Product:Developer Tools Product Version:3.2
Classification:Enhancement Reproducible:N/A
 
Summary: 

IntelliJ IDEA automatically inserts import statements while you are typing, and detects non-imported classes found in pasted blocks of code. When a class is found, that has not yet been imported, IntelliJ IDEA displays a hint and allows you to quickly insert the required statement with Alt+Enter. 

Having something similar in Xcode would be fantastic.

Ideally, it would work like so:

1. In Xcode type "CalTask *newTask = nil;"
2. A drop-down appears asking if you want to import <CalendarStore/CalendarStore.h>
3. Press Command-Enter and "import <CalendarStore/CalendarStore.h>" is added to the top of the class's .m file.

Comments

So there is this feature in Xcode Version 13.2.1 (13C100) BUT it's sooo bad. I want to turn it off. Proof: https://stackoverflow.com/questions/69839535/xcode-13-turn-off-auto-import-feature/69917221

Please

I need this feature too !

Mine got marked as a duplicate of 4464001 . So this has been requested for a while.

Also duped as 7700086

I had totally forgotten about this feature from IntelliJ it's been so long since I've used it. So many good things Xcode could steal from there. Duped with 7677214.


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!