To begin using the Editor, create or open an existing file using File>New File or File>Open File, respectively. Additional controls and features are described in the following sections.
Desktop Controls
The following desktop items are associated with the Editor:
Display Controls
Basic display controls are shown in the table below. Additional formatting control may be found under Editor Options.
Action | Description |
---|---|
Maximize the Source Editor. | Do one of the
following:
|
Revert a maximized Source Editor to its previous size. | Do one of the
following:
|
Display line numbers. | Choose View>Show Line Numbers. |
View two files simultaneously. |
|
Split the view of a single file. |
|
Move between open files |
|
Format code automatically. | Right click in the
Source Editor and choose “Format.” If any text is selected, only that text will be formatted. If no text is selected, then the whole file is formatted. |
Basic Editor Features
The following table summarizes some of the more frequently-used features of the editor.
Editor Feature | Reference |
---|---|
Unicode is supported. | By default,
newly-created projects in the IDE use ISO-8859-1 character encoding. To change
this: Right click the project name in the Projects window and choose Properties. In the left column under “Categories,” select “General.” On the bottom of the page, find “Encoding” and change. |
Code is colored based on syntax. | Tools>Options (MPLAB X IDE>Preferences
for macOS), Fonts and Colors button, Syntax tab. Based on Encoding set during Project creation. |
Errors are flagged as code is typed. | See the table of
contents for the Netbeans Help topic: https://netbeans.org/kb/docs/java/editor-codereference.html#coloring |
Colored markers provide quick access to multiple symbols, errors, etc. | Tools>Options (MPLAB X IDE>Preferences for macOS), Fonts and Colors button, Annotations tab |
Smart code completion makes suggestions and provides hints. | Tools>Options (MPLAB X IDE>Preferences for macOS), Editor button, Code Completion tab |
Mouseover symbols in debug mode to see values. | On halt when
debugging, mouse over symbols to see values. Note: You cannot view the value of
macros in this way. Use the Macro Expansion Window by right clicking (or
Cmd+Alt+Click for macOS) on the macro in the editor during
debug.
|
Assembly and C code may be collapsed and expanded | See Code Folding. |
Right clicking on a
function (delay(x) ) finds usages. This can limit find within a
function (e.g., a local i variable). |
See the Netbeans
Help topic: http://wiki.netbeans.org/Find_Usages_in_Compiled_Dependencies |
Right clicking on a
function (delay(x) ) shows a call graph
The call graph has
buttons on the side to switch order, etc. |
See “View The Call Graph.” |
Create comments
with keywords (example: //TODO ) in the source code and action
items will be scanned and added automatically to the Action Items
window. |
See the Netbeans
Help topic: https://netbeans.org/features/ide/index.html regarding the Options Window, Team: Action Items. |
File history is available to view recent changes and revert, even without a version control system. | Control Source Code using Local History |
Navigation is simplified with items such as “Go to file,” “Go to type,” “Go to symbol,” “Go to header,” and “Go to declaration.” | See “Navigate Menu.” |
Refactor options (rename functions and variables, find all functions, etc.) for improving code structure. | See C Code Refactoring. |
Editor Troubleshooting
For errors in code highlighted in the editor, see your compiler documentation. For information on error highlighting, see the NetBeans help topic:
https://netbeans.org/kb/docs/java/editor-codereference.html#coloring
Specific errors may be found under Errors.