gh-actions-language-server
v0.0.3
Published
**GitHub Actions Language Server**
Downloads
223
Readme
gh-actions-language-server
GitHub Actions Language Server
A lightweight wrapper around @actions/languageserver to simplify installation and usage in CLI tools and LSP (Language Server Protocol) clients.
Why?
The @actions/languageserver
module is published without an executable binary (see issue #56), which makes it less convenient to use directly. This package bridges that gap by providing an easy-to-install binary.
Initially, the plan was to contribute a pull request to @actions/languageserver
to add a bin
field. However, it seems that configuring package exports for this purpose requires some adjustments, so creating this standalone package was a quicker solution.
Note: This package may be archived and deprecated once native support for a bin
executable is added to @actions/languageserver
.
Installation
To install globally via npm, run:
npm install --global gh-actions-language-server
Configuration for Neovim
If you're using nvim-lspconfig, you can configure the gh-actions-language-server
as follows:
Define the Language Server Configuration
Create a new configuration file at lua/lspconfig/configs/gh_actions_ls.lua
with the following content:
return {
default_config = {
cmd = {
'gh-actions-language-server',
'--stdio',
},
filetypes = {
'yaml',
},
single_file_support = true,
root_dir = function(fname)
if fname:match('.github/workflows') then
return vim.fn.getcwd()
end
end,
},
}
Initialize the Language Server
Add the following code to initialize the language server:
require('lspconfig').gh_actions_ls.setup({})
Credits
- https://github.com/actions/languageservices