nix.nvim/nvim/ftplugin/sh.lua
2024-10-01 12:55:40 +02:00

23 lines
605 B
Lua

-- Exit if the language server isn't available
if vim.fn.executable('bash-language-server') ~= 1 then
return
end
local root_files = {
'.env',
'.vscode',
'.git',
}
vim.lsp.start {
name = 'bashls',
cmd = { 'bash-language-server', 'start' },
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
-- capabilities = require('user.lsp').make_client_capabilities(),
single_file_support = true,
on_attach = function(client, bufnr)
require("nvim-navic").attach(client, bufnr)
require("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr)
end,
}