From 23d53b5d7bc2f31eed672c0a8d26dc608fb6d0ba Mon Sep 17 00:00:00 2001 From: Ibrahim Muftee Date: Mon, 4 Aug 2025 07:45:42 -0500 Subject: feat(nvim) slim down new config --- dot_config/nvim_new/lsp/ada_ls.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 dot_config/nvim_new/lsp/ada_ls.lua (limited to 'dot_config/nvim_new/lsp/ada_ls.lua') diff --git a/dot_config/nvim_new/lsp/ada_ls.lua b/dot_config/nvim_new/lsp/ada_ls.lua new file mode 100644 index 0000000..ff43d9a --- /dev/null +++ b/dot_config/nvim_new/lsp/ada_ls.lua @@ -0,0 +1,30 @@ +---@brief +--- +--- https://github.com/AdaCore/ada_language_server +--- +--- Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). +--- +--- Workspace-specific [settings](https://github.com/AdaCore/ada_language_server/blob/master/doc/settings.md) such as `projectFile` can be provided in a `.als.json` file at the root of the workspace. +--- Alternatively, configuration may be passed as a "settings" object to `vim.lsp.config('ada_ls', {})`: +--- +--- ```lua +--- vim.lsp.config('ada_ls', { +--- settings = { +--- ada = { +--- projectFile = "project.gpr"; +--- scenarioVariables = { ... }; +--- } +--- } +--- }) +--- ``` + +local util = require 'lspconfig.util' + +return { + cmd = { 'ada_language_server' }, + filetypes = { 'ada' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('Makefile', '.git', 'alire.toml', '*.gpr', '*.adc')(fname)) + end, +} -- cgit v1.2.3