Skip to main content

Editors

Setting up your editor

The command alr edit launches your editor on the current crate, with the appropriate enviroment variables and settings. You can adjust the editor that gets started by alr edit with Alire's editor.cmd setting.

Ada Language Server

The Ada Language Server is an implementation of Microsoft's Language Server Protocol customised for Ada. Some of the editors can be configured or have a plugin to use this so you might not need to install it directly.

GNAT Studio

Alire is configured to work with GNAT Studio by default if you have it installed.

To edit your project, run this from your project directory:

alr edit

Visual Studio Code

See the main Visual Studio Code site.

You can get the Ada Language Server Plugin from the Visual Studio Marketplace.

On the command line, the command to open VSCode in the current directory is code ., so that's what we tell alr edit.

alr settings --set --global editor.cmd "code ."

Now you can edit your project with:

alr edit

Vim

  • Ada Bundle - A set of plugins for using Ada with VIM.

Emacs

There are two Emacs extensions (modes) that support Ada. The older is Emacs Ada Mode, the newer is Ada TS Mode. Ada TS Mode uses the Ada Language Server.

See this note for how to install the ada-ts-mode extension.

Set Alire to use Emacs when invoking alr edit:

alr settings --set --global editor.cmd 'emacs --eval=(ada-build-prompt-select-prj-file"${GPR_FILE}") ${GPR_FILE}'

Zed

From Zed extensions interface, search for an extension called Ada and click install, make sure that you have the LSP installed, you may need to restart your IDE.