7.1 Editor Usage
To begin using the Editor, create or open an existing file using
or , respectively. Additional controls and features are described in the following sections.Desktop Controls
The following desktop items are associated with the Editor:
- File menu – opens a file in an Editor window (see 13.1.1 File Menu).
- Edit menu – accesses edit commands (see 13.1.2 Edit Menu).
- Editor toolbar – also accesses edit commands – located at the top of each file’s Editor window (see 13.2.11 Editor Toolbar).
- Window right-click (context) menu – for additional commands.
Display Controls
Basic display controls are shown in the table below. Additional formatting control may be found under 7.2 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 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. | MPLAB X IDE >
Preferences for macOS), . Based on Encoding set during Project creation. |
(
Errors are flagged as code is typed. | See the Netbeans Help topic Using Hints. |
Colored markers provide quick access to multiple symbols, errors, etc. | MPLAB X IDE > Preferences for macOS), | (
Smart code completion makes suggestions and provides hints. | MPLAB X IDE > Preferences for macOS), | (
Mouseover symbols in debug mode to see values. | On halt when
debugging, mouse over symbols to see values. The default value format for mouseover evaluation relies on type information available from the debug information source (e.g. ELF). This format will be overridden when the symbol (by name) has had a format option applied to the value column in the Watches or Variables window. Value column format options applied to a symbol in the Watches window will persist from session to session until removed. 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 7.6 Code Folding. |
Right clicking on a
function (delay(x) ) finds usages. This can limit find within a
function (e.g., a local i variable). |
If selected, all usages of the method are displayed. |
Right clicking on a
function (delay(x) ) shows a call graph
. The call graph has
buttons on the side to switch order, etc. |
See 8.4 Call Graph. |
Create comments
with keywords (example: //TODO ) in the source code and action
items will be scanned and added automatically to the 14.2 Action Items Window. |
See the Netbeans
Help topic: 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. | 8.8 Source Control: 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 7.7 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:
netbeans.org/kb/docs/java/editor-codereference.html#coloring
Specific errors may be found under 12.5 Errors.