mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
indent(hcl): fix function calls
This commit is contained in:
parent
b1e8b61a94
commit
82e43748cf
4 changed files with 12 additions and 11 deletions
|
|
@ -63,8 +63,8 @@
|
|||
] @string
|
||||
|
||||
[
|
||||
(heredoc_identifier) ; <<END
|
||||
(heredoc_start) ; END
|
||||
(heredoc_identifier) ; END
|
||||
(heredoc_start) ; << or <<-
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
|
|
|
|||
|
|
@ -2,21 +2,14 @@
|
|||
(block)
|
||||
(object)
|
||||
(tuple)
|
||||
(function_call)
|
||||
] @indent
|
||||
|
||||
[
|
||||
(block_end)
|
||||
(object_end)
|
||||
(tuple_end)
|
||||
] @branch
|
||||
|
||||
|
||||
[
|
||||
"]"
|
||||
")"
|
||||
"}"
|
||||
] @indent_end
|
||||
|
||||
] @branch @indent_end
|
||||
|
||||
(comment) @auto
|
||||
(ERROR) @auto
|
||||
|
|
|
|||
6
tests/indent/hcl/function_call.tf
Normal file
6
tests/indent/hcl/function_call.tf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
test {
|
||||
x = f(
|
||||
a,
|
||||
b,
|
||||
)
|
||||
}
|
||||
|
|
@ -29,5 +29,7 @@ describe("indent HCL:", function()
|
|||
run:new_line("multiple-attributes.tf", { on_line = 4, text = "a = 1", indent = 0 })
|
||||
run:new_line("nested_blocks.tf", { on_line = 3, text = "a = 1", indent = 4 })
|
||||
run:new_line("nested_blocks.tf", { on_line = 4, text = "a = 1", indent = 2 })
|
||||
run:new_line("function_call.tf", { on_line = 4, text = "c,", indent = 4 })
|
||||
run:new_line("function_call.tf", { on_line = 5, text = "a = 1", indent = 2 })
|
||||
end)
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue