Code Assistance in the MPLAB® X IDE Editor
Code Assistance
Code Assistance is a feature that analyzes the first few characters you have typed and provides a list of possible endings. For example, if you are using a library with a series of functions that start with 'lcd', after typing in those letters, you will see a list of functions such as 'lcdInit()' and 'lcdWrite()' displayed for you to select from.
To activate the Code Assistance window:
When activated, you will be presented with a list of all identifiers (macros, variables, functions, etc.) that start with those letters. Double-clicking on any item in the list will add it to your code by completing the text you started to type in.
Selecting an item in the list (single click) displays a documentation window that by default will have nothing in it. You need to provide the content for this window using specially formatted comments in your code.
Once you have inserted a new function, a tooltip will appear to prompt you for any required parameters. If there are multiple parameters, the next one to be entered will be highlighted with bold text.
Code Documentation
The Code Assistance window can display documentation for the selected identifier.
To create documentation for a function, you need to add a Javadoc comment block immediately above the function prototype (or definition if available) that starts with '/**' on the first line. The editor can assist you by auto-populating a basic Javadoc comment block.
To add a documentation comment with the editor's assistance:
*
* @param num
* @param radix
*/
void lcdPutInt(long num, char radix);
On the first line with a '*', you can type in a description of the function. The @param lines were added automatically based on the parameter list of the function immediately below. You can add comments after each parameter on the same line and they will also appear in the documentation window.
The documentation shown in the image above was generated by the following comments immediately above the lcdPutCur function declaration.
* Positions the cursor on a character LCD module at the specified row and column, both of which are zero-based.
* @param row Row number of the display, where the top row is 0.
* @param column Column number of the display, where the leftmost column is 0.
*/
void lcdPutCur(char row, char col);
Code Assistance Options
Enable or disable the automatic display of code assistance