You can use Code Assist to help insert or finish a tag or function or line of code in the editor as well as to select and insert templates.
The location of the cursor in the source file provides the context for the code assist to offer suggestions for completion.
To request code assist while in the Editor:
Press Ctrl+Space
In addition, you can set a preference that causes code assist to pop up automatically when certain characters are typed, as in HTML and XML.
Setting PHP Preferences
Code Assist Options
Keywords:
Select Preferences from the Window menu.
Go to PHP | Editor | Code Assist.
Select your configuration options.
Figure 1: Setting Code Assist Preferences
Set the Code Assist Preferences as shown below:
Completion Inserts / Completion Overwrites: Code completion will insert or overwrite code, as chosen. Default = "Completion Inserts"
Insert single proposals automatically: When only one code completion suggestion exists, the code completion suggestion will be entered automatically.
Show variables from other files: Choose if to show variables which are in other files in the project. By default, this option should be chosen.
Determine object type from other files: Shows object types from other files. Default = Selected.
Show constants assist: Displays constsnts in Code Assist. Default = Selected.
Case sensitive for constants: Constants are case sensitive. Default = Not Selected.
Show class name in Global Completion list: Enables/Disables the addition of class names to the code completion list. Default = Selected.
Enables auto activation for class names, variables, functions, keywords and constants. Default = Selected.
Activation delay: Determines Code Assist's activation delay. Default = 200.
Auto activation triggers for PHP: Sets the characters that determine PHP context. Default = " $ : > "
Note: A maximum of 4 characters can be entered.
|
__CLASS__ |
DECLARE |
EXTENDS |
PHP_USER_FILTER |
|
__FILE__ |
DEFAULT |
FINAL |
|
|
__FUNCTION__ |
DIE |
FOR |
PRIVATE |
|
__LINE__ |
DO |
FOREACH |
PROTECTED |
|
__METHOD__ |
ECHO |
FUNCTION |
PUBLIC |
|
ABSTRACT |
ELSE |
GLOBAL |
REQUIRE |
|
AND |
ELSEIF |
IF |
REQUIRE_ONCE |
|
ARRAY |
EMPTY |
IMPLEMENTS |
RETURN |
|
AS |
ENDDECLARE |
INCLUDE |
STATIC |
|
BREAK |
ENDFOR |
INCLUDE_ONCE |
SWITCH |
|
CASE |
ENDFOREACH |
INTERFACE |
THROW |
|
CATCH |
ENDIF |
ISSET |
TRY |
|
CFUNCTION |
ENDSWITCH |
LIST |
UNSET |
|
CLASS |
ENDWHILE |
NEW |
USE |
|
CLONE |
EVAL |
OLD_FUNCTION |
VAR |
|
CONST |
EXCEPTION |
OR |
WHILE |
|
CONTINUE |
EXIT |
|
XOR |
Select Preferences from the Window menu.
Select Web and XML Files from the navigator, followed by HTML Files. Expand. Select HTML Source.
In the Code Assist group box, select the Auto-Activation check box.
Supply any additional characters that should trigger code assist .
If the cursor location enables Code Assist, a pop-up list of all available choices is displayed. A brief description of the code is provided for each.
Complete the options for HTML Styles and HTML Source.