Skip to content

Commit f051cfa

Browse files
committed
Merge branch 'topic/alire' into 'edge'
Initial implementaiton of Alire support. See merge request eng/ide/ada_language_server!1128
2 parents f3eab06 + 5e0a409 commit f051cfa

File tree

21 files changed

+1045
-110
lines changed

21 files changed

+1045
-110
lines changed

README.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ for Ada/SPARK.
1313
Current features:
1414

1515
* [GNAT project files](https://docs.adacore.com/gprbuild-docs/html/gprbuild_ug/gnat_project_manager.html) support.
16+
* Basic [Alire](https://alire.ada.dev/) support.
1617
* Code completion for names, keywords, aggregates, etc.
1718
* Code navigation, such as Go to Definition/Declaration, Find All References, Call Hierarchies, etc.
1819
* [Code refactoring](#refactoring-tools) like insert named associations, auto-add `with`-clauses, etc.
@@ -32,10 +33,6 @@ extension at
3233
- [Dependencies](#dependencies)
3334
- [Usage](#usage)
3435
- [Supported LSP Server Requests](#supported-lsp-server-requests)
35-
- [General Requests](#general-requests)
36-
- [Workspace Requests](#workspace-requests)
37-
- [Synchronization Requests](#synchronization-requests)
38-
- [Text Document Requests](#text-document-requests)
3936
- [Protocol extensions](#protocol-extensions)
4037
- [How to use the VScode extension](#how-to-use-the-vscode-extension)
4138
- [Getting started](#getting-started)
@@ -44,12 +41,13 @@ extension at
4441
- [Commands and shortcuts](#commands-and-shortcuts)
4542
- [Launch the extension to debug it](#launch-the-extension-to-debug-it)
4643
- [Configuration](#configuration)
47-
- [Integration with Coc.NVim](#integration-with-cocnvim)
48-
- [Integration with vim-lsp](#integration-with-vim-lsp)
49-
- [Integration with LanguageClient-Neovim](#integration-with-languageclient-neovim)
50-
- [Integration with Neovim's built-in LSP client](#integration-with-neovims-built-in-lsp-client)
44+
- [Integration with other editors and IDEs](#integration-with-other-editors-and-ides)
45+
- [Integration with Coc.NVim](#integration-with-cocnvim)
46+
- [Integration with vim-lsp](#integration-with-vim-lsp)
47+
- [Integration with LanguageClient-Neovim](#integration-with-languageclient-neovim)
48+
- [Integration with Neovim's built-in LSP client](#integration-with-neovims-built-in-lsp-client)
5149
- [Integration with emacs lsp-mode](#integration-with-emacs-lsp-mode)
52-
- [Integration with QtCreator](#integration-with-qtcreator)
50+
- [Integration with QtCreator](#integration-with-qtcreator)
5351
- [Refactoring Tools](#refactoring-tools)
5452
- [Authors & Contributors](#authors--contributors)
5553
- [Contribute](#contribute)
@@ -77,7 +75,7 @@ To build the language server you need:
7775
* The [VSS](https://github.com/AdaCore/VSS) library
7876
* The [gnatdoc](https://github.com/AdaCore/gnatdoc) library
7977
* The [gpr](https://github.com/AdaCore/gpr) library
80-
* The a process [spawn](https://github.com/AdaCore/spawn) library
78+
* The process [spawn](https://github.com/AdaCore/spawn) library
8179

8280
Project files of the libraries must be available via the `GPR_PROJECT_PATH`
8381
environment variable.
@@ -126,7 +124,12 @@ formatting might no succeed on incomplete/illegal code.
126124

127125
* **Toooling support**: we currently provide minimal support for *SPARK* (see *Prove/Examine* tasks in the [Auto-detected tasks](#auto-detected-tasks) section), but there is no support for tools such as *CodePeer*, *GNATcheck*, *GNATtest* or *GNATcoverage*.
128126

129-
* **Project support**: there is no `Scenario` view: users should configure scenarios via the *ada.scenarioVariables* setting (see the settings list available [here](doc/refactoring_tools.md)). You can execute the *Developper: Reload Window* command to reload your project after saving the new scenario values (use the *Ctrl+P* shortcut to invoke the **Command Palette**, allowing you to execute commands).
127+
* **Alire support**: if the root folder contains an `alire.toml` file and
128+
there is `alr` executable in the `PATH`, then the language server fetches
129+
the project's search path, environment variables and the project's file
130+
name from the crate description.
131+
132+
* **Project support**: there is no `Scenario` view: users should configure scenarios via the *ada.scenarioVariables* setting (see the settings list available [here](doc/refactoring_tools.md)). You can execute the *Ada: Reload project* command to reload your project after saving the new scenario values (use the *Ctrl+P* shortcut to invoke the **Command Palette**, allowing you to execute commands).
130133

131134
Source directories from imported projects should be added in a [workspace file](https://code.visualstudio.com/docs/editor/workspaces#_multiroot-workspaces). If you already have a workspace file, the extension will propose you to automatically add all the source directories coming from imported projects to your workspace automatically at startup.
132135

@@ -224,7 +227,9 @@ Here is an example config file from the gnatcov project:
224227
}
225228
```
226229

227-
## Integration with Coc.NVim
230+
## Integration with other editors and IDEs
231+
232+
### Integration with Coc.NVim
228233

229234
If you want to use the Ada Language Server with Vim/Neovim, you can use the
230235
[Coc.NVim](https://github.com/neoclide/coc.nvim). You'll have to
@@ -252,7 +257,7 @@ configure the Ada Language Server with `:CocConfig`:
252257
}
253258
```
254259

255-
## Integration with vim-lsp
260+
### Integration with vim-lsp
256261

257262
If you want to integrate the Ada Language Server into vim, you can use the
258263
[vim-lsp](https://github.com/prabirshrestha/vim-lsp).
@@ -273,7 +278,7 @@ if executable('ada_language_server')
273278
endif
274279
```
275280

276-
## Integration with LanguageClient-Neovim
281+
### Integration with LanguageClient-Neovim
277282

278283
If you want to integrate the Ada Language Server into Neovim, you can use the
279284
[LanguageClient-neovim](https://github.com/autozimu/LanguageClient-neovim).
@@ -317,7 +322,7 @@ the language server *even for files which might have nothing to do with that
317322
specific project*, so this needs to be taken into account. Ultimately what this
318323
means is that the configuration is determined by where you open vim.
319324

320-
## Integration with Neovim's built-in LSP client
325+
### Integration with Neovim's built-in LSP client
321326

322327
Neovim 0.5.0 and later have a built-in LSP client which can be used with the
323328
Ada Language Server. In order to use it with minimal effort, follow these steps:
@@ -391,7 +396,7 @@ for the `ada_language_server` and defines default customizable configuration
391396
values in the `lsp-ada` group that can be edited similarly to
392397
`lsp-ada-project-file` in the example above.
393398

394-
## Integration with QtCreator
399+
### Integration with QtCreator
395400

396401
Starting with version `4.9`, QtCreator supports a LSP plugin. Follow
397402
[the official documentation](https://doc.qt.io/qtcreator/creator-language-servers.html)

gnat/lsp_server.gpr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- Language Server Protocol --
33
-- --
4-
-- Copyright (C) 2018-2022, AdaCore --
4+
-- Copyright (C) 2018-2023, AdaCore --
55
-- --
66
-- This is free software; you can redistribute it and/or modify it under --
77
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -20,6 +20,7 @@ with "libadalang";
2020
with "lal_tools.gpr";
2121
with "ada_libfswatch.gpr";
2222
with "libgnatdoc.gpr";
23+
with "spawn.gpr";
2324

2425
with "lsp";
2526

0 commit comments

Comments
 (0)