Dynamic Feedback in the MPLAB® X IDE Editor

Last modified by Microchip on 2023/11/09 09:11

This section discusses the dynamic feedback features of MPLAB® X Integrated Development Environment (IDE), including error stripe and glyph margin.

Error Stripe And Glyph Margin

Error strip and the glyph margin


Error Stripe

Features

  • Represents the entire length of the file.
  • Colored bars indicate some condition at that relative position in the file (see the color code).
  • Hovering the mouse pointer over a bar will display a tool tip with information about the underlying condition.
  • Clicking on a colored bar will bring that line of the file into view within the editor and move the cursor to the beginning of that line.

The error stripe is the bar immediately to the right of the vertical scroll bar and provides a convenient means to quickly navigate among several elements of your code. The error stripe's vertical bar represents the entire length of the file currently displayed in the editor - not just what is visible at the moment. During the course of development, different colored bars (see the color code) may appear from time to time to indicate a variety of conditions that exist throughout your code such as syntax errors, search results, breakpoint locations, and so on. Each colored bar indicates the position of these conditions throughout the entire length of the file. To view a specific line, click on the colored bar and that line will be made visible in the editor and the cursor will be placed at its beginning.

Two of the most useful indicators in the error stripe are Errors and Occurrences.

Errors

The MPLAB X IDE editor has a live parsing feature that examines your code as you write it. If it detects any problems like syntax errors or other non-runtime problems, it will flag the line with a red bar in the error stripe and add an error icon on top of that line's number in the glyph margin.

Occurrences

Occurrences are displayed in the error stripe under two related circumstances. First, if you perform a search and the IDE finds any matches in the currently displayed file, it will flag them with a gold bar in the error stripe and will also highlight them in the editor with a similar color. Second, if you select (highlight) something in the editor, any matches will automatically be highlighted and flagged in the error stripe as if you had performed a search. In both cases, you can quickly jump to each occurrence of the search result by clicking on the bar in the error stripe.

Back to Top


Glyph Margin

Features

  • Displays line numbers.
  • Displays icons to match most error stripe indicators (see the color code).
  • Clicking on a line number sets a line breakpoint.
  • Clicking on a breakpoint icon clears the breakpoint.
  • Right-clicking on a line number or breakpoint icon produces a popup menu with additional options for breakpoints and bookmarks.

The glyph margin is the gray area to the immediate left of the editor where the line numbers are displayed. From time to time, you may see an icon (also known as a glyph) replace the line number to indicate some condition that exists on that line. Hovering the mouse pointer over a glyph will display a tool tip with more detailed information about the specific condition(s). Sometimes, you may see a small black arrow icon which indicates that there are multiple conditions on that line. Clicking on the black arrow will cycle through all the glyphs that apply to that line.

Back to Top


Live Parsing

Back to Top


Remove Highlighting from Search Results or Selection Matches

After you've searched for and found a variable's or function's name, you may want to remove the highlighting that enabled you to find it. Follow the steps below to see an easy way to remove the highlighting.

The MPLAB X IDE editor will highlight each instance where a match has been found from either a search or when some text is selected in the editor. For example if you select (highlight) a variable's name, each instance of that variable within the file will also be highlighted and indicated with a gold bar in the error stripe. While this feature can be invaluable for finding what you are looking for, it can also be a nuisance when you are done and no longer wish to see all those items highlighted. With the default settings, the highlighted items will not return to normal until you select or search for another item. To change this behavior and make it so that clicking in blank space will remove the highlighting, do the following:

  1. From the main menu select Tools > Options.
  2. In the window that opens, click on the Editor icon along the top then, click Highlighting, and uncheck the Keep Marks option. To disable the highlighting feature altogether, uncheck the Mark Occurrences Of Symbol Under Caret option.
  3. Click the OK button.

Keep marks option in the Tools Options Editor window

Back to Top