Skip to content
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: add support for GH actions Language server #506

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

comatory
Copy link

@comatory comatory commented Jan 9, 2025

Adds support for Github Actions.

Caution

I'm not familiar with the codebase and I've never added such configuration. I could use help on this one.

I tried looking at other PRs to see whether I'm doing it right.

Adds support for Github Actions.
@@ -238,12 +238,13 @@ return {
xsd = { "lemminx" },
xsl = { "lemminx" },
xslt = { "lemminx" },
yaml = { "azure_pipelines_ls", "hydra_lsp", "snyk_ls", "spectral", "yamlls" },
yaml = { "azure_pipelines_ls", "github_actions_ls", "hydra_lsp", "snyk_ls", "spectral", "yamlls" },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think yaml.github should suffice, we don't need to register it for all YAML files. then we can even get rid of the runtime check in lspconfig root_dir

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally I am using this rule for my config (in ftdetect). I guess this would need to be registered somewhere, not sure where it's done for yaml.gitlab which is very similar

vim.filetype.add({
  pattern = {
    ['.*/%.github[%w/]+workflows[%w/]+.*%.ya?ml'] = 'yaml.gha', -- could be yaml.github instead
  },
})

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it from yaml see: 584b05a

I guess this would need to be registered somewhere, not sure where it's done

Yeah I wonder too, it would be great if users wouldn't have to worry about it. Should there be some init script for like /lua/mason-lspconfig/server_configurations/pylsp/init.lua?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked it up for the existing GitLab CI LS and there it is also the user's responsibility to add the filetype pattern. I guess if it gains enough traction it might be worth upstreaming into Neovim core.
For now I am just using my own little wrapper plugin https://github.com/disrupted/github-actions.nvim which defines and lazy-loads using ftdetect

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah or we can just document that ppl need to register the pattern, as long as it's part of the docs, it's OK .

Copy link

@disrupted disrupted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to open a PR for lspconfig as well

edit: neovim/nvim-lspconfig#3551

@comatory comatory requested a review from disrupted January 9, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants