Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions lsp/gh_actions_ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,21 @@
--- ```
return {
cmd = { 'gh-actions-language-server', '--stdio' },
-- the `root_markers` with `workspace_required` prevent attaching to every yaml file
filetypes = { 'yaml' },
root_markers = {
'.github/workflows',
'.forgejo/workflows',
'.gitea/workflows',
},
workspace_required = true,

-- `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 = {
Expand Down
Loading