Xcode can highlight instances of selected symbol, but what it does is to add dash lines under the instances, which is hard to be noticed.
AutoHighlightSymbol is a plugin for Xcode, it adds background highlight color to those instances. It's super useful while you're tracing codes, especially when you want to figure out where a specific variable is used in a certain method.
This plugin is still in early beta, you're welcome to improve it and send me pull requests.
-
Use Alcatraz to install and manage plugins, or
-
Download the sources, build the project and restart Xcode.
-
If you encounter any issues you can uninstall it by removing the ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/AutoHighlightSymbol.xcplugin folder.
-
You need to enable Highlight instances of selected symbol option first from Xcode preferences -> Text Editing.
-
If it doesn't appear in your Xcode menu, read this wiki document for more information.
-
After installation, you need to enable it from Xcode [Editor] -> [Auto Highlight Symbol] menu.
- Integrate into Alcatraz
- Better highlight detection mechanism (Try to swizzle
DVTLayoutManager
's_displayAutoHighlightTokens
method) - Better highlight rendering mechanism
AutoHighlightSymbol is available under the MIT license. See the LICENSE file for more info.
Any suggestions or improvements are more than welcome. Feel free to contact me at [email protected] or @NelsonT.
AutoHighlightSymbol cannot be done without these great plugins.
And these great articles.