Code Assist

The Code Assist feature enables the selection and insertion of existing code elements to complete partially entered code.

A list of possible code elements appears in relevant locations within your files according to the context of your cursor, which you can then select to be automatically entered into your code.

 

Each type of code element will have a unique icon:

Reserved PHP Words

Functions

Templates

Classes

Interfaces

Constants

Variables (public)

PHP File Include Call

 

Code Assist works with the following elements: PHP Classes, Functions, Variables, Constants, Keywords, Interfaces, attributes, values, nested functions, names, syntax and include calls, as well as all user defined Classes, Functions and Constants.

Using elements within the same scope

Elements within the same active project, file or function will be available for use with Code Assist.

 

Usage Example

Examples:

  • Variables within a function will be added to the Code Assist list when the cursor is within that function.

  • Elements defined within one file will be available in the Code Assist menu in other files within the same project.

 

Function Parameter Hints  

When entering a function call, a Function Parameter Hint box will be displayed detailing the types of parameters which should be entered within the parentheses of the function call.

 

If the Function Parameter Hint box is not displayed automatically, place your cursor between the parentheses and press Ctrl+Shift+Space.

 

Code Assist for Include Statements

Code Assist can be activated for require and include calls to call files contained within the same project.

Inserting quotation marks between the parentheses of an include/require call will cause the Code Assist window to display the files available for the function. Selecting a file will complete the include/require call.

 

 

Usage Example

Example:

 

Configuring Code Assist

To configure code assist options, go to the Code Assist Preferences page, accessed from Window Menu | Preferences | PHP | Editor | Code Assist.

 

 

Related Links

Related Links:

Working with Code Assist

Using Code Assist

Code Assist Preferences

Hover Support

Commenting PHP DocBlocks

Using Templates