901 B
901 B
HCL and Terraform parsers that treat {% as comment lines for... reasons. iykyk 🤷
Neovim usage with the nvim-treesitter plugin
local configs = require("nvim-treesitter.configs")
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
local jhcl_repo = "https://code.buildbetter.boats/jenterkin/tree-sitter-jhcl"
parser_config.hcl = {
install_info = {
url = jhcl_repo,
files = { "src/parser.c", "src/scanner.c" },
}
}
parser_config.terraform = {
install_info = {
url = jhcl_repo,
files = { "src/parser.c", "src/scanner.c" },
location = "dialects/terraform",
}
}
configs.setup({
-- ...
-- We overwrote the default `nvim-treesitter` configs for `hcl` and
-- `terraform` above, so we can include them in `ensure_installed` normally
ensure_installed = {
-- ...
"hcl",
"terraform",
-- ...
},
-- ...
})