-
-
Notifications
You must be signed in to change notification settings - Fork 848
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
Support terraform-vars highlighting #6465
Comments
PR welcome |
We don't take requests. If you know of a (good) parser and are willing to write (compatible) queries, please do so; otherwise you'll just have to wait until someone is motivated. |
I was under the understanding that the syntax in |
It sounds like something essential to support *.tfvars file highlighting. |
PR welcome; languages are user-contributed. |
For anyone who came across this issue, you can just set syntax for local my_group = vim.api.nvim_create_augroup('MyGroup', { clear = true })
-- fix highlighting in *.tfvars
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
group = my_group,
pattern = { '*.tfvars' },
command = 'set syntax=tf',
}) |
A better approach (probably; I have no idea about the relation between terraform and terraform-vars files, hence my leaving this to the community) would be to register the |
Indeed, this also works and looks less hacky. Thanks! vim.treesitter.language.register('terraform', { 'terraform', 'terraform-vars' }) |
Describe the bug
There seems to be a missing parser for tfvars. The filetype in neovim is
terraform-vars
. The related line in Neovim https://github.com/neovim/neovim/blob/206475d7919ccdefd32022a32b204c8941b48fa6/runtime/lua/vim/filetype.lua#L1072To Reproduce
echo 'example = true' > test.tfvars && nvim test.tfvars
.:set ft=terraform
and notice how the text is highlightedExpected behavior
code is highlighted.
Output of
:checkhealth nvim-treesitter
Output of
nvim --version
Additional context
No response
The text was updated successfully, but these errors were encountered: