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

Add additional YAML injections #8217

Merged
merged 1 commit into from
Sep 10, 2023
Merged

Add additional YAML injections #8217

merged 1 commit into from
Sep 10, 2023

Conversation

gjabell
Copy link
Contributor

@gjabell gjabell commented Sep 9, 2023

Adds injections for Github Actions & Gitlab CI.

Taken from https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/yaml/injections.scm, which is licensed under Apache-2.0. Let me know if I need to change the license text here :)


;; Github actions ("run") / Gitlab CI ("scripts")
(block_mapping_pair
key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script")
Copy link
Member

Choose a reason for hiding this comment

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

We don't support #any-of?. This will need to be rewritten as a #match?: (#match? @_run "^(run|script|before_script|after_script)$")

Copy link
Member

Choose a reason for hiding this comment

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

Note: any-of? Was added upstream to tree-sitter now

Copy link
Member

Choose a reason for hiding this comment

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

Ah yep, once we update tree-sitter we'll have support for #any-of?. The commit we are currently pinned to came right before that change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can switch it to match unless tree-sitter is expected to be updated soon?

Copy link
Member

@the-mikedavis the-mikedavis Sep 10, 2023

Choose a reason for hiding this comment

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

We're looking to update again when the next release of tree-sitter gets cut but we're not sure when that will be yet.

For now #match? is good

runtime/queries/yaml/injections.scm Outdated Show resolved Hide resolved
@the-mikedavis the-mikedavis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. A-language-support Area: Support for programming/text languages labels Sep 9, 2023
Adds injections for Github Actions and Gitlab CI.
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 10, 2023
@pascalkuthe pascalkuthe merged commit acef759 into helix-editor:master Sep 10, 2023
6 checks passed
@gjabell gjabell deleted the add-yaml-injections branch September 10, 2023 20:52
dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants