IDE 25 Release Notes

We present here a few highlights of the new features in IDE products for the 25 release.

Ada Language Server for GPR files

A separate Ada Language Server instance is now launched specifically for GPR files, providing common IDE features such as completion, outline, tooltips, and navigation in GPR files via the LSP. This helps editing and understanding project files directly from GNAT Studio or Visual Studio Code.

_images/gpr_support.gif

SPARK in VS Code

A few improvements have been made in the VS Code extension regarding SPARK integration. In particular predefined tasks for GNATprove have been added in order to prove a subprogram, a file or the whole project.

In addition, the extension will now display code lenses above subprograms and files to prove code directly from an opened editor.

_images/spark_codelens.gif

GNATtest in VS Code

An integration for GNATtest is now available through the Ada & SPARK VS Code extension, providing the following functionalities: predefined tasks to create/update test skeletons for the loaded project, and allowing you to run and visualize all your tests from the VS Code Testing view.

_images/gnattest-test-tree.png

Project Diagnostics

The Ada Language Server now emits diagnostics for all the warnings and errors that were found while loading a project. These diagnostics are shown in GNAT Studio’s Locations view and VS Code’s Problems panel. These diagnostics can be disabled via a GNAT Studio preference (Enable project diagnostics in the Editor/Ada/Diagnostics preferences page) or, if you are using the Ada & SPARK VS Code extension, via the Ada: Project Diagnostics setting.

_images/project_diagnostics.gif

Formatting

The Ada Language Server now relies on a new formatter called GNATformat, replacing the old GNATpp formatter, which will be baselined soon.

This formatter is based on the Prettier formatter engine, which has been ported to Ada. The intent of GNATformat is to format valid Ada source code according to the coding style described in the GNAT Coding Style guide. The ability to customize the formatting style through configuration files will be progressively added in the next GNATformat versions.

_images/formatting_vscode.png

The VS Code extension for Ada & SPARK now uses GNATformat by default but users can fallback to GNATpp by disabling the Ada: Use GNATformat setting.

Regarding GNAT Studio, GNATformat is disabled by default until the complete transition to this new formatter, including preferences and formatting of whole projects. You can still experiment with it for file and range formatting based on the LSP by enabling the GPS.LSP.FORMATTING.ADA trace.

Editing and Completion

Tooltips for attributes, aspects and pragmas are now supported in the Ada Language Server.

_images/tooltips_attributes.gif

Selecting completion items that are not visible in the current scope will now automatically trigger the Ada Language Server’s auto-import command, adding the missing with clauses and prefixing with a qualifier if needed. This can be disabled via the Insert with clauses preference, in the Editor/Ada preferences page.

_images/invisible_completion.gif

LSP-based Semantic Highlighting is now available in GNAT Studio. This allows to highlight differently more fine-grained semantic categories, for instance to distinguish constants from writable variables. You can enable this feature via the LSP Semantic Highlighting preference in the LSP preferences page. The colors for each category can then be customized through the Semantic section of the Editor/Fonts & Colors preferences page.

_images/semantic_highlighting.png

Debugging

GNAT Studio now supports Microsoft’s Debug Adapter Protocol to debug Ada code.

The idea behind the Debug Adapter Protocol is to standardize an abstract protocol for how a development tool communicates with concrete debuggers, similarly to what the LSP does for languages. This makes interactions with underlying debuggers faster and more reliable in the long-run.

The implementation has some limitations for now, in particular regarding remote debugging: thus it needs to activated manually by enabling the GPS.DEBUGGING.DAP_MODULE trace. You will also need a recent GDB version (25 release at least) to benefit from the best user experience.

_images/dap_debugging.gif

Using the DAP module comes with a few UX improvements: the Call Stack view now will automatically select the first reachable frame, opening its source location, and will gray out the frames that are not accessible (i.e: when the source path does not exist on disk).

Alire integration

When opening a .gpr file belonging to an Alire project (i.e: when the project’s directory contains an alire.toml file), GNAT Studio is now able to correctly load it by running the alr printenv command to set up the needed environment, displaying a message in the Locations view once it’s setup. The default build targets to build and clean projects are also replaced by the respective Alire commands (alr build and alr clean).

_images/alire_project_gs.png

On the VS Code extension’s side, a few bugs have been fixed regarding the Alire integration. In particular the Ada Language Server for GPR files is now also able to load Alire projects. Note that all the predefined tasks provided by the Ada & SPARK VS Code extension will run through Alire: for instance, the ada: Build current project task will run the alr build command and tasks that spawn external tools will be prefixed by alr exec.