Skip to main content

Editors

Setting up your editor

You can adjust the editor that gets started by alr edit with Alire's editor.cmd setting. Launching your editor this way with alr edit causes Alire to start it with the appropriate environment variables and settings.

Language server

Ada has a language server. Some of the editors can be configured or have a plugin to use this so you might not need to install this 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

Make a workspace.code-workspace in your project folder with the name of your gpr file.

{
"folders": [
{
"path": "."
}
],
"settings": {
"ada.projectFile": "my_project_name.gpr"
}
}

Set Alire to look for a workspace.code-workspace in whatever directory you're trying to open.

alr config --set editor.cmd "code workspace.code-workspace"

As long as you make a workspace file, you can now edit your projects with:

alr edit

Vim

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

Emacs

Install the ada-mode extension from GNU ELPA.

Set Alire to use Emacs when invoking alr edit:

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