diff options
| author | Ibrahim Muftee <ibrahim@muftee.net> | 2025-08-04 07:45:42 -0500 |
|---|---|---|
| committer | Ibrahim Muftee <ibrahim@muftee.net> | 2026-07-01 00:23:31 -0400 |
| commit | 23d53b5d7bc2f31eed672c0a8d26dc608fb6d0ba (patch) | |
| tree | 7b23cd20340dd0984bb1a9616744ef81c69d3b4c /dot_config/nvim_new/lsp/gh_actions_ls.lua | |
| parent | 1227ae992f4494d6a3d82d70d0bb9cb01dd50847 (diff) | |
feat(nvim) slim down new config
Diffstat (limited to 'dot_config/nvim_new/lsp/gh_actions_ls.lua')
| -rw-r--r-- | dot_config/nvim_new/lsp/gh_actions_ls.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/dot_config/nvim_new/lsp/gh_actions_ls.lua b/dot_config/nvim_new/lsp/gh_actions_ls.lua new file mode 100644 index 0000000..62e3d9e --- /dev/null +++ b/dot_config/nvim_new/lsp/gh_actions_ls.lua @@ -0,0 +1,40 @@ +---@brief +--- https://github.com/lttb/gh-actions-language-server +--- +--- Language server for GitHub Actions. +--- +--- The projects [forgejo](https://forgejo.org/) and [gitea](https://about.gitea.com/) +--- design their actions to be as compatible to github as possible +--- with only [a few differences](https://docs.gitea.com/usage/actions/comparison#unsupported-workflows-syntax) between the systems. +--- The `gh_actions_ls` is therefore enabled for those `yaml` files as well. +--- +--- The `gh-actions-language-server` can be installed via `npm`: +--- +--- ```sh +--- npm install -g gh-actions-language-server +--- ``` +return { + cmd = { 'gh-actions-language-server', '--stdio' }, + filetypes = { 'yaml' }, + + -- `root_dir` ensures that the LSP does not attach to all yaml files + root_dir = function(bufnr, on_dir) + local parent = vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr)) + if + vim.endswith(parent, '/.github/workflows') + or vim.endswith(parent, '/.forgejo/workflows') + or vim.endswith(parent, '/.gitea/workflows') + then + on_dir(parent) + end + end, + + init_options = {}, -- needs to be present https://github.com/neovim/nvim-lspconfig/pull/3713#issuecomment-2857394868 + capabilities = { + workspace = { + didChangeWorkspaceFolders = { + dynamicRegistration = true, + }, + }, + }, +} |
