Automatically (or manually) fills in the code you type at the editor, based on scope. Also provides instant access to recent single-line clipboard operations.
This plug-in makes it easy to:
Insert the names of components on your form in the code
Insert any of your most-recent one-liner clipboard operations at the cursor
Insert parameters to the current method at the cursor
Call a method declared by the class
Access a property or field variable declared by the class
The AutoFill plug-in is highly configurable to the way you work. It is strongly recommended that you read through this documentation before installing, so you can get the most from the plug-in.
This plug-in provides basic AutoFill functionality. After installing and enabling automatic AutoFill, the AutoFill plug-in will be active. To use it, just write code as you normally would. When the plug-in detects one or more suggestions matching the code you've typed in Delphi, it will display a suggestion to the right of the cursor.
After typing in "od", AutoFill activates with a suggestion.
Once AutoFill is active, you have several options:
Press Enter to accept the highlighted suggestion. AutoFill will ensure the entire suggestion is properly cased (to match the declaration). Alternatively, you can also accept the suggestion by pressing the open parenthesis ("(") or period (".") keys.
Press Shift+Enter to accept a portion of the suggestion. Shift+Enter accepts from the cursor to the character preceding next uppercase letter in the suggestion. For example, if "FAllowMultipleSelections" was the suggestion, and "fa" had been typed in, pressing Shift+Enter successive times would cause the selection to shift as follows:
Shift+Enter is useful when you need to create a new variable name that is similar to a portion of an existing suggestion, or when you want to quickly access a different but similarly-named suggestion (differing only in the latter portions of the text). You can press Shift+Enter to move the selection right, and then start typing to get other suggestions.
If more than one entry is suggested (as shown on the Delphi Status bar), you can cycle through the suggestions by pressing the Up and Down arrow keys.
Press the Delete key to cancel the suggestion.
Do nothing for a few moments and AutoFill will be cancelled (providing you've specified this deactivation option).
If the text you've entered is a keyboard template that you want to expand, just press the space bar to expand the template normally.
Continue typing (narrowing down the suggestion list or ultimately ignoring all suggestions).
How AutoFill Collects Suggestions
Suggestions for AutoFill are dynamically parsed from the current method & class, and include parameters to the current method, variables declared locally, methods, properties, and field identifiers from the current class, and the most recent single-line clipboard operations. These suggestions are sorted, with recently-selected suggestions optionally appearing at the top of the list. Because AutoFill has such a narrow focus of scope, it is more appropriate to use on empty lines than Delphi's Code Completion.
In addition to basic AutoFill functionality, this plug-in registers seven new commands that can be assigned to a keystroke, toolbar button, or a menu item. The commands are detailed below:
This command presents the AutoFill Options dialog. One easy way to access this command is through the CodeRush About box. After installing this plug-in, bring up the CodeRush About box, open the AutoFill node, right-click the AutoFillOptions command and select "Execute...".
The AutoFill Options dialog is described in more detail here.
This command invokes the AutoFill logic based on the text to the left at the cursor. This command is useful when you want to manually invoke AutoFill. You can bind a shortcut key to this command using the CodeRush Options dialog, or by using the Shortcuts page of the AutoFill Options dialog.
This command displays the Find Entry dialog.
Using the Find Entry dialog to select and paste an AutoFill entry.
This command is for developers that have the SmartParenWithEmbed command bound to their open parenthesis key (e.g., Shift+9 or Shift+8 for some non-U.S. keyboards). This is the default for a CodeRush install. If you want the open parenthesis key to accept the selection when AutoFill is active, you'll need to replace your existing Shift+9 (or Shift+8 keymapping), with the following:
This command will invoke the SmartParenWithEmbed command whenever the open parenthesis is pressed and AutoFill is not actively suggesting entries. However, if AutoFill is suggesting entries and the open parenthesis key is pressed, the current suggestion will be accepted (selected text will be deselected) before SmartParenWithEmbed is called.
If you do not reassign the open paren key binding for this command (in other words, the open parenthesis key remains bound to the SmartParenWithEmbed command), pressing the open parenthesis key when AutoFill is active will result in the current suggestion becoming embedding inside parentheses.
You can reassign this shortcut key by following these steps:
From the CodeRush menu, select Options....
Click the Shortcuts tab.
Click the Command header to sort by CodeRush command.
Locate the SmartParenWithEmbed command.
Change this command to "AutoFillOpenParenRedirect(SmartParenWithEmbed)".
This command accepts the current highlighted suggestion (clearing the highlight and placing the cursor to the right of the suggestion).
For example, if you want the period key (".") to accept the current suggestion and add a period to the end of the suggestion, create a key-binding to this shortcut in the CodeRush Options dialog. Be sure to select the "Send key to Delphi" option if you want the character you press to be inserted after the suggestion.
Setting up the period (".") character to accept suggestions.
Note that characters bound to the AutoFillAcceptSuggestion command will behave normally when AutoFill is inactive.
This command displays the Global Suggestion Manager dialog which allows you to add or remove AutoFill suggestions that will be offered nearly every time that AutoFill is invoked.
You can bind this command to a keystroke execute it directly from the Plug-ins page of the CodeRush About box. Once the dialog is up, simply add any suggestions that you would like to always be available from AutoFill. It is recommended that you keep this list small to avoid suggestion bloat.
This list is persistent (saved in your CodeRush folder in the AutoFill.glo text file).
Extended Clipboard History
This dialog can be reused to display a list of all recent single-line clipboard operations (cuts and copies performed in the Delphi edit window), use this command:
You can also click the Select Clipboard Entries toolbar button, if it is installed on your toolbar, and you can quickly bind a shortcut key to this command using the Shortcuts page of the AutoFill Options dialog.
The AutoFill plug-in registers four toolbar buttons with CodeRush. The buttons can be found in the AutoFill category, and are described below.
AutoFill Popup. Invokes the AutoFillPopup command, bringing up the Find Entry dialog so you can select from suggestions that match the text at the cursor.
Select Clipboard Entries. Allows you to select from recent single-line clipboard operations in Delphi that match the text at the cursor. You can determine how many clipboard entries AutoFill tracks using the Clipboard Options page of the AutoFill Options dialog.
AutoFill Options. Brings up the AutoFill Options dialog.
Reload AutoFill Plug-ins. Unloads and then immediately reloads any extensions copied to the AutoFill subdirectory (inside your CodeRush folder).
You can configure the AutoFill functionality through the AutoFill Options dialog. To bring up this dialog, invoke the AutoFillOptions command, or click the AutoFill Options button, if it is installed on your toolbar. For more information on AutoFill options, please click here.
The AutoFill plug-in has an advanced architecture that alloww it to load other plug-ins. For more information about AutoFill's plug-ins and its extension architecture, please click here.
If Delphi changes the source programmatically CodeRush is not notified of these changes. We anticipate that Borland will correct this Tools API limitation in Delphi 6, however in CodeRush 5, if this happens, AutoFill will not be aware of the latest additions. For example, if you drop several components on a form AutoFill won't know to re-parse the class declaration. The work-around is to move the cursor to the class declaration, add a line, remove it, then save (forcing CodeRush to realize a change has occurred). You can also force a parse by closing and then reopening the file.
Method parameters and variables are not suggested in static procedures (procedures not belonging to a class).
If AutoFill fails to pick up on changes to a method, the work-around is to page up out of it and then back into it (forcing AutoFill to re-parse the method).
Copyright 2004 Ackerson Software, All Rights Reserved.
Author: Arno van Jaarsveld and Mark Miller
Created: Sept. 22, 2000
Plug-In Type: Standard
Options Page: Yes
This plug-in is NOT currently supported.
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.