[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
13.1 The Tools Menu 13.2 Visual Comparison 13.3 Code Fixing
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Tools
menu gives access to additional tools. Some items are
currently disabled, meaning that these are planned tools not yet available.
The list of active items includes:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The visual comparison, available either from the VCS menus or from the Tools menu, provide a way to display graphically differences between two files, or two different versions of the same file.
This tool is based on the standard text command diff
, available
on all Unix systems. Under Windows, you need to provide a proper equivalent,
by e.g. installing a set of Unix tools such as cygwin
(http://www.cygwin.com).
The dialog is composed of two main areas: on the left side, the reference file is displayed; on the right side, the modified file.
By default, only chunks of differences are displayed, with a number of lines of context around, that can be parametrized in the preferences dialog.
Vertical and horizontal scroll bars are available for each file that allow you to scroll both files at the same time. In addition, empty lines are added when needed so that the two files can always be displayed side by side and stay synchronized.
Colors are used to display the different kinds of chunks:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GPS provides an interactive way to fix or improve your source code, based on messages (errors and warnings) generated by the GNAT compiler.
This capability is integrated with the Locations tree (see 2.8 The Locations Tree): when GPS can take advantage of a compiler message, an icon is added on the left side of the line.
For a simple fix, a wrench icon is displayed. If you click with the left button on this icon, the code will be fixed automatically, and you will see the change in the corresponding source editor. An example of a simple fix, is the addition of a missing semicolon.
You can also check what action will be performed by clicking on the right button which will display a contextual menu with a text explaining the action that will be performed. Similarly, if you display the contextual menu anywhere else on the message line, a sub menu called Code Fixing gives you access to the same information. In the previous example of a missing semicolon, the menu will contain an entry labeled Add expected string ";".
Once the code change has been performed, the tool icon is no longer displayed.
For more complex fixes, where more than one change is possible, the icon will display in additional of the tool, a red question mark. In this case, clicking on the icon will display the contextual menu directly, giving you access to the possible choices. For example, this will be the case when an ambiguity is reported by the compiler for resolving an entity.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |