From 71eac2ab32b22bf6c2b430632761e5d1930fe81e Mon Sep 17 00:00:00 2001 From: Crashdummy Date: Tue, 21 Jan 2025 01:12:36 +0100 Subject: feat(gh_actions_ls): recognize .forgejo, .gitea as root_dir #3566 --- lua/lspconfig/configs/gh_actions_ls.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/configs/gh_actions_ls.lua b/lua/lspconfig/configs/gh_actions_ls.lua index c40c5e25..8325e071 100644 --- a/lua/lspconfig/configs/gh_actions_ls.lua +++ b/lua/lspconfig/configs/gh_actions_ls.lua @@ -9,8 +9,11 @@ return { -- files. (A nil root_dir and no single_file_support results in the LSP not -- attaching.) For details, see #3558 root_dir = function(filename) - return filename:find('/%.github/workflows/.+%.ya?ml') and util.root_pattern('.github')(filename) or nil + return filename:find('/%.(github|forgejo|gitea)/workflows/.+%.ya?ml') + and util.root_pattern('.github', '.forgejo', '.gitea')(filename) + or nil end, + -- Disabling "single file support" is a hack to avoid enabling this LS for -- every random yaml file, so `root_dir()` can control the enablement. single_file_support = false, @@ -29,7 +32,12 @@ https://github.com/lttb/gh-actions-language-server Language server for GitHub Actions. -`gh-actions-language-server` can be installed via `npm`: +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 -- cgit v1.2.3-70-g09d2