This plug-in is a unit navigation tool that allows you to get to methods very quickly (as well as see a preview of the method before you commit). It gives a developer the ability to search the unit and see all occurrences of a particular identifier. Arguably, the best thing about this plug-in is it's blazing speed; it is easily twice as fast as class/method combobox navigation.
When asked about the Unit Navigator, Mark Miller was quoted as saying, "It's my favorite plug-in not installed with CodeRush."
The Unit Navigator plug-in registers four new commands with CodeRush; these new commands are PerfectLayout, LaunchUnitNavigator, LaunchLazyExpert, and LaunchMacroQuickEdit. These commands provide access to the following features:
Details about the plug-in follow; to see the Unit Navigator in action, click here.
The Perfect Layout feature is a handy little function for maximizing screen real estate. Simply bind a keystroke to the PerfectLayout command to have CodeRush automatically resize the open IDE windows to use up all available space on-screen regardless of your screen resolution. To return to the top, click here.
The Unit Navigator provides virtually everything a developer needs to quickly and easily navigate through a body of source code. Bind a keystroke to the new command LaunchUnitNavigator to gain access to this utility. When invoked, the Unit Navigator dialog appears with the active unit from the Delphi IDE loaded. This dialog has a clear, uncluttered interface, as seen below:
It is comprised of the following elements, as indicated above:
This section of the Unit Navigator controls the content that appears in the Method Declaration window. It also provides features to interact with the Delphi editor.
The features offered on the Unit Navigator Toolbar will vary based upon the active Filter Mode. For example, when the (default) Methods Filter mode is active, the Unit Navigator Toolbar will appear as follows:
However, when in Units Filter mode, it will look like this:
The toolbar has a similar look in each of these modes and provides similar features; however, in Methods Filter mode, there are more options available.
Filter Criteria - Notice the edit box labeled "Pattern:". It is from here that a developer is able to control the display of data in the Method Declaration Window. Any text entered here is immediately processed as a filter condition. Only items matching the entered text will be displayed in the Method Declaration Window.
Toogle Methods/Unit Filter - This button, or the [F12] key shortcut, toggles Unit Navigator modes between the Methods Filter and the Units Filter. When changing between these modes, both the Unit Navigator Toolbar and the Options Toolbar will change as needed. Additionally, the content of the Method Declaration Window will change.
Drop a Bookmark - This button drops a CodeRush bookmark in the Delphi IDE at the start of the implementation of the current method in the Unit Navigator.
Jump to Class Declaration - This option is only available in Methods Filter mode. Selecting this option causes this plug-in to read the class at the current cursor location in the Unit Navigator and jump to the declaration of that class in the Delphi IDE.
Jump to Class Implementation - This option is only available in Methods Filter mode. Selecting this option causes this plug-in to read the class at the current cursor location in the Unit Navigator and jump to the first implementation line of that class in the Delphi IDE.
Jump to Selected - This button, or the [Enter] key shortcut, causes this plug-in to jump to a particular line of code in the Delphi IDE. This feature differs from the previous "Jump To" functions in that it works with pure lines of code, not just class headers. As such, it will allow you to navigate to classless methods, comments, initialization/finalization sections, etc.
Cancel - Closes the Unit Navigator dialog.
Method Declaration Window
The Method Declaration Window displays a filterable list of method declarations to aid in navigating a Delphi unit. It is from this window that the Unit Navigator determines the "active" method or line of code to work with for the navigation options on the main toolbar. Additionally, navigation through this window causes the Code Preview Window to be refreshed, allowing the user to instantly preview the implementation of any method in a unit.
The content of the Method Declaration Window will vary based upon the active Filter Mode. For example, when the (default) Methods Filter mode is active, the window will appear something like this:
However, when the Units Filter mode is active, the Method Declaration Window will display the actual body of the unit itself complete with line numbers, starting from line 1, as follows:
Code Preview Window
The Code Preview Window displays the body of the method currently selected in the Method Declaration Window. No user intervention is required to keep these two windows in sync. The Unit Navigator automatically handles that for you. This window is extremely useful as it allows you to preview a method during navigation to determine whether or not you need to jump to it.
During Method Filter mode, this window will appear something like this:
When in Units Filter mode, this window resembles the Method Declaration Window (without the added line numbers).
Options Toolbar / Statusbar
This section of the Unit Navigator provides functionality as well as informational context.
The features offered on the Options Toolbar will vary based upon the active Filter Mode. For example, when the (default) Methods Filter mode is active, the Options Toolbar will appear as follows:
However, when in Units Filter mode, the Options Toolbar will look like this:
First among the features of the Options Toolbar are a pair of visibility controls. Hide Not Implemented and Hide Class Name allow you to fine tune the display of the Method Declaration Window. By default, these options are unchecked. Next is Filter On Class Name which allows you to control the behavior of the toolbar's Filter Criteria. By default, this option is checked. Finally, "AbstractPublic / Published" is a legend defining how items are displayed in the Method Declaration Window.
The Statusbar is limited to two panes of content. The rightmost pane simply displays the current date and time. The leftmost pane displays a counter field. The type of information presented in this pane varies based upon the current Filter mode. When in Methods Filter mode, this pane represents a counter of the method headers displayed in the Methods Declaration Window. When in Units Filter mode, this pane presents a source code line counter.
To see the Unit Navigator in action, click here. To return to the top, click here.
Lazy Instanciation Expert
By binding a keystroke to the new LaunchLazyExpert command, CodeRush will be able to prompt you with a simple dialog for instantiating and freeing objects. The dialog, seen below, allows you to choose an instantiation type and declare specifics about the object being instantiated:
Simply specify the Base Name you wish to reference this object by and the object's type and the Lazy Instanciation Expert will add all the necessary bits of declaration information. As needed, private members will be added to your form, variables will be declared in your code, accessor methods will be created, a destructor will be created and object freeing code will be added to it.
To see the Lazy Instanciation Expert in action, click here. To return to the top, click here.
Default Macro Editor
Delphi allows you to record a keystroke macro by pressing the Ctrl+Shift+R key combination. The macro can be played back by pressing Ctrl+Shift+P. Unfortunately, Delphi provides no easy way to edit a recorded macro. This command provides such an ability.
Bind a keystroke to the LaunchMacroQuickEdit command to have CodeRush display a simple macro editing dialog, as seen below:
By default, this current system macro is populated with the active macro.
To see the Macro Quick Editor in action, click here. To return to the top, click here.
This plug-in requires John's custom String Utilities plug-in to be installed. You can find information about it here.
This plug-in is not the property of Developer Express; it is the sole property of its author. As such, Developer Express cannot be held liable for any incidental damages that may be related to the usage of this plug-in.