Apex Code Completion

The Code Сompletion feature gives you the ability to improve your productivity and reduce the number of possible mistakes in a code. It helps to concentrate on writing code instead of remembering the right property and method. This feature is available for different types of files with Apex code — regular classes, Triggers, and Anonymous Apex files. All of them have the same level of support and Code Assistance features.

Apex Code Completion

The specific Code Completion features depend on the language you are using. They're available within Apex, and Javascript editors. Also, this feature is present in all .js files, as well as in other file types that use Javascript: Visualforce, HTML, and Lightning. In addition, you have the ability to use the Code Completion feature for Javascript's JsDoc in the comments. If a cursor is placed on a comment, after entering the @ symbol you will see a list of JsDoc tags.

Code completion feature for Javascript's JsDoc in comments

You can easily manage all general options of the Code Completion from the Main Menu: Tools ⇒ Options ⇒ Code Assistance.

List Members

One of the most often used features of Code Completion is the List Members option. When you type some code, The Welkin Suite offers you a scope of possible variants to insert. For example, it can be a list of options after a period, or a list of available tags after an opening tag brace <. If you continue typing characters, the list is filtered to include only the members that begin with those characters. The most suitable item to insert is highlighted in the Code Completion list.

NB: The Welkin Suite provides you with full support for generics in Apex — this means, that when you're looking for methods / properties of the list itself, you'll get them in a completion list, but when you're looking for completions for the list items, you'll get the completions for the generic types, but not for the List types.

The list includes only the items that apply to your current context, and it uses only the active project. It provides you with more context-tailored completions, as well as it removes all the items that are irrelevant to the current context suggestions. The search for the correct suggestion for each case looks both on upper- and lowercases. The most recently used items usually are at the top of the suggestions list. In case there are no items which begin with the text you've entered, the Code Completion doesn't show any suggestions.

Every item in this list has an icon that represents its type, such as namespace, class, function, or variable, including global apex classes, sObjects and fields, that are part of managed packages. All the scope of the list members is filtered by their types. Below the list of possible variants to insert a list of types is present. Click on a necessary one, and the list members will be filtered to the matching items. You can select several types at the same time.

Apex Code Completion

If the list is long, you can scroll it using the Page Up or Page Down buttons.

If you select an item, you will see a tip with information about this member near it. To insert a member, double-click on it, or just press Tab.

The List Members feature is automatically called when you type some code. You can invoke it manually from the Main Menu: Edit ⇒ Code Completion ⇒ List Members, or by pressing the Ctrl+J hotkey.

You are also able to turn off the List Members option. Navigate to the Main Menu: Tools ⇒ Options ⇒ All languages and deselect the checkbox Auto list members, or uncheck this option in the settings for the specific language you want.

Signature Helper

The Signature Helper feature shows you information about the method's parameters when you start typing them. It detects “,” and highlights the current parameter that you're entering as well as the Apex Doc information for the given parameter. Additionally, you're able to see all the overloads of the method and switch between them using the and keys or with a mouse.

Signature Helper

Complete Word

The Complete Word option completes the rest of a variable, command, or function name once you have entered enough characters to determine the term. You can call the Complete Word option from the Main Menu: Edit ⇒ Code Completion ⇒ Complete Word, or by pressing the Ctrl+Space hotkey.

Braces Completion

One more option that helps to work more efficient is the Brace Completion feature. When you enter any opening brace ((, [, <, {), The Welkin Suite automatically adds the closing brace. If you press the Backspace button, the IDE will remove all inserted braces (opening and closing).

By default, this option is turn on. You can turn it off from the Options Menu: Main Menu ⇒ Tools ⇒ Options ⇒ Code Assistance and uncheck the box Auto-complete braces; or navigate to the settings for the specific language you want.

Closing Tag Completion

The Closing Tag completion feature is quite similar to the Braces Completion. The Welkin Suite automatically creates a closing tag once you write an opening tag. If you change the opening tag, the closing tag is also automatically changed to match it.

This option is active for all the editors that use HTML tags: Visualforce, Lightning, and the HTML editor itself. You can manage it in the settings for the specific language you want.

Advanced Code Completion

Some editors also support advance Code Completion functions: intelligent code completion and hints are displayed automatically for HTML tags, their attributes, inline (inside a 'style' attribute) CSS, and standalone CSS code. All of these you can find in the 'Advanced' section of the settings for the specific language you want (Tools ⇒ Options ⇒ Text Editor ⇒ %lang%).

In this section:

This also may be useful:

Last modified: 2017/12/06 14:27

footer image