diff --git a/lua/lspconfig/configs/gh_actions_ls.lua b/lua/lspconfig/configs/gh_actions_ls.lua new file mode 100644 index 0000000000..b745158516 --- /dev/null +++ b/lua/lspconfig/configs/gh_actions_ls.lua @@ -0,0 +1,40 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'gh-actions-language-server', '--stdio' }, + filetypes = { 'yaml.github' }, + root_dir = util.root_pattern('.github'), + single_file_support = true, + capabilities = { + workspace = { + didChangeWorkspaceFolders = { + dynamicRegistration = true, + }, + }, + }, + }, + docs = { + description = [[ +https://github.com/lttb/gh-actions-language-server + +Language server for GitHub Actions. + +The server is registered for the special `yaml.github` filetype. You need to configure this filetype pattern for GitHub workflow files. + +```lua +vim.filetype.add({ + pattern = { + ['.*/%.github[%w/]+workflows[%w/]+.*%.ya?ml'] = 'yaml.github', + }, +}) +``` + +`gh-actions-language-server` can be installed via `npm`: + +```sh +npm install -g gh-actions-language-server +``` +]], + }, +}