-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: gh-actions-language-server #3551
Merged
justinmk
merged 4 commits into
neovim:master
from
disrupted:feat/gh-actions-language-server
Jan 13, 2025
+40
−0
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` | ||
]], | ||
}, | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that
root_dir
can be a function, so it could inspect the contents of every.yaml
file to decide if it's a GH workflow.I'll leave that as a followup for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a standard way to identify GitHub YAML anyway. I mean, there are some specifics like
inputs,
maybe? But they're optional - there's also the slight difference between Workflow & Action so detecting this wouldn't be reliable anyway I think.