Skip to content

Commit

Permalink
feat: ada_language_server
Browse files Browse the repository at this point in the history
The configuration for the Ada Language Server was first added in neovim#171 and
removed in neovim#3310. The removal happened due to misunderstandings, it was thought
at the time that the default language server configuration could not work on its
own (neovim#1683), it turns out that this was actually caused by a bug in the ALS that
was fixed a long time ago. This means the default ALS configuration can be
re-introduced.

However, in the meantime, a new neovim plugin for Ada was created and the name
"als" was borrowed, thus we have to use a new name, ada_language_server, in
order to avoid breaking this plugin.

This reverts commit 7b8b0b3.
  • Loading branch information
glacambre committed Oct 23, 2024
1 parent edd9591 commit 39a1550
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions lua/lspconfig/configs/ada_language_server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
local util = require 'lspconfig.util'
local bin_name = 'ada_language_server'

if vim.fn.has 'win32' == 1 then
bin_name = 'ada_language_server.exe'
end

return {
default_config = {
cmd = { bin_name },
filetypes = { 'ada' },
root_dir = util.root_pattern('Makefile', '.git', '*.gpr', '*.adc'),
},
docs = {
description = [[
https://github.com/AdaCore/ada_language_server
Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install).
Can be configured by passing a "settings" object to `ada_language_server.setup{}`:
```lua
require('lspconfig').ada_language_server.setup{
settings = {
ada = {
projectFile = "project.gpr";
scenarioVariables = { ... };
}
}
}
```
]],
default_config = {
root_dir = [[util.root_pattern("Makefile", ".git", "*.gpr", "*.adc")]],
},
},
}

0 comments on commit 39a1550

Please sign in to comment.