Feature call auto complete
Overview
EiffelStudio editor provides automatic help for completing feature calls.
With the default EiffelStudio preferences, feature call auto-completion occurs automatically when you type a dot ('.') character after a feature name.
This means, for example, that in the Editor pane when you type:
my_string.
the editor will propose a list of possible valid feature names from which to choose, as seen in Figure 1.
Feature call auto-completion can also be triggered:
- By pressing
crtl+space
- By following the edit menu path:
Edit --> Advanced --> Complete word
Feature call auto-completion is most commonly used in the Editor pane. But the same functionality is also available elsewhere in EiffelStudio, for example:
- Expressions in the editable grid of the Watch tool.
- "Expression" in the New Expression dialog of the Watch tool.
- "Condition" in the Breakpoints dialog
The feature call auto-completion window
Using the example above, when auto-completion is triggered, the feature call auto-completion window will pop up and display a list of feature names which can be applied in the current context.
Figure 1. The feature auto-completion window.
When the auto-completion window appears, the first item in the list, if any, will be selected. To complete your code with the selected item, press "Enter" or "Ctrl+Space". To choose another item, use keyboard Up and Down arrows or the mouse.
You can also continue typing characters and the list will automatically be narrowed provided that you have non-matching entries filtered out (see Auto-completion list display options below). So, you can think of the auto-completion as a search for feature names using the characters you type followed by a wild card character, the asterisk ('*'). Of course, you don't have to put the asterisk at the end, it's just always implied. Once you've triggered auto-completion, you can however use the wild card character in the middle of a string, like this:
my_string.a*int
which would narrow the list to all feature names starting with "a
" and also containing the string "int
".
To validate your choice, press "Enter" or "Ctrl+Space".
If there is no selected item, the content of the text you have typed will be inserted.
The auto-completion can be cancelled by clicking outside the window or pressing Esc
.
Entering routine arguments
After you have selected a feature, if the feature is a routine requiring arguments, the argument prototypes will be included in the generated feature text, and the text for the first argument will be selected, as in Figure 2.
Figure 2. Auto-completion of a routine with arguments.
Because the text for the first argument is already selected, you can go ahead and type a value for that argument. When you've completed the first argument, press Tab
, and the next argument will be selected, and you can type a value for it. When you Tab
after entering the final argument, the cursor will be positioned after the right parenthesis, so you are ready to move on.
Auto-complete list display options
At the bottom of the auto-completion window you will find a row of icons labeled "Options:". These options help you control which choices are presented to you and the format of their presentation. The options are described in the section on class name auto-completion.