| Crates.io | tree-sitter-gh-actions-expressions |
| lib.rs | tree-sitter-gh-actions-expressions |
| version | 0.3.2 |
| created_at | 2025-09-18 03:29:19.185829+00 |
| updated_at | 2025-09-24 16:23:44.39718+00 |
| description | Github Actions expressions grammar for tree-sitter |
| homepage | |
| repository | https://github.com/hdoc1509/tree-sitter-gh-actions-expressions |
| max_upload_size | |
| id | 1844210 |
| size | 153,281 |
Tree-sitter grammar for Github Actions expressions
gitignore
(optional): for hashFiles() functionjson (optional): for
fromJSON() functionyaml: injection to its
block_mapping_pair nodeAdd the following to your nvim-treesitter configuration:
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
-- NOTE: add the parser to `parser_config` before calling `setup()`
parser_config.gh_actions_expressions = {
install_info = {
url = 'https://github.com/Hdoc1509/tree-sitter-gh-actions-expressions',
files = { "src/parser.c" },
branch = 'release',
-- if ABI version from neovim doesn't match the one from this grammar
-- requires Node.js and tree-sitter cli to be installed
requires_generate_from_grammar = true,
},
}
require('nvim-treesitter.configs').setup({
ensure_installed = {
-- other parsers
'gh_actions_expressions',
},
-- other options
})
Copy the queries from queries directory to
queries/gh_actions_expression directory in your neovim configuration
directory:
| With | Path |
|---|---|
| Unix | ~/.config/nvim |
| Windows | ~/AppData/Local/nvim |
XDG_CONFIG_HOME set |
$XDG_CONFIG_HOME/nvim |
Add the following queries to after/queries/yaml/injections.scm in your
neovim configuration directory:
; extends
; don't forget to include `extends` modeline!
((block_mapping_pair
key: (flow_node) @_key
value: [
(block_node
(block_scalar) @_value)
(flow_node
[
(plain_scalar
(string_scalar) @_value)
(double_quote_scalar) @_value
])
]
(#lua-match? @_value "${{")) @injection.content
; NOTE: to avoid weird behaviours with `bash` injections
(#not-eq? @_key "run")
(#set! injection.language "gh_actions_expressions")
(#set! injection.include-children))
((block_mapping_pair
key: (flow_node) @_key
(#eq? @_key "if")
value: (flow_node
(plain_scalar
(string_scalar) @_value)
(#not-lua-match? @_value "${{"))) @injection.content
(#set! injection.language "gh_actions_expressions")
(#set! injection.include-children))
WIP
WIP
You can get the built files from the release branch. If you
have specific instructions for your editor, PR's are welcome.
WIP
Thanks to @disrupted for creating tree-sitter-github-actions grammar, which is the base I used to create this grammar.