GNATbench Project File Editor

GNATbench provides a simple syntax-oriented editor for GNAT Project Files. Although the GUI interface discussed elsewhere is likely more convenient in most cases, occasionally you may want to edit the file directly.

The editor is associated with files having an extension of ".gpr" (standing for "Gnat PRoject") and is thus invoked by double-clicking on the project file itself. If the default system editor is invoked, you can reassign the GNATbench editor by selecting "Open With -> GNAT Project File Editor" in the contextual menu.

Project files are simply text files with an Ada-like syntax. The purpose of the editor is facilitate making syntactically correct changes to these files. To that end, the primary feature of the editor is syntax-driven entity coloring. The colors follow the selections made within the Ada editor for corresponding syntactic categories.

An example project file illustrating this coloring is shown in the figure below.

project file editor debug-release example

Additionally, the project file editor supports some of the same editor capabilities as the Ada source editor. Specifically, the comment toggle, text refill, smart indenting tab key, and construct closing commands are supported.

The Outline view is also supported for packages, variables, and types.

project file outline view