
42
|
Chapter 2, Master the Editor
#8 Master IntelliSense
HACK
instance, if you typed in HttpR, it would automatically complete the rest of
the object name (HttpRequest). If there are a number of objects that match
what you have typed in, it will display the full list of members with the first
match highlighted. Figure 2-7 shows what the listbox would look like if you
only typed in the letter P.
You can also press Ctrl-Space on a blank line and be shown a complete list
of members in the current context. This is a great way to find a variable
name that has slipped your mind. Figure 2-8 shows an example of this.
This shortcut can be even more useful if you name all of your private mem-
ber variables with a common prefix; for instance, if all of your variables are
prefixed with “_”, by typing
_ and then pressing Ctrl-Space, you would dis-
play a list of all of your variables to choose from.
Parameter Info
Another useful form of IntelliSense is the parameter information that is
shown after you type the opening parenthesis of a method (it goes away
when the parentheses are closed). When editing an already existing method,
it would be nice to have this information again without having to delete and
then reenter the opening parenthesis, wouldn’t it? As long as the cursor is
Figure 2-7. IntelliSense listbox, brought to you by the letter P
Figure 2-8. IntelliSense listbox showing all members