terraform: Update indents (#17200)
Taras Martyniuk
and
Marshall Bowers
created
Closes #15988
Fixed indent configuration for terraform/HCL
Release Notes:
- N/A
https://github.com/user-attachments/assets/09b44ac9-ef09-463c-876d-0fbcdd1f09c9
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Change summary
extensions/terraform/languages/hcl/config.toml | 1 +
extensions/terraform/languages/hcl/indents.scm | 8 +++++---
extensions/terraform/languages/terraform-vars/config.toml | 1 +
extensions/terraform/languages/terraform-vars/indents.scm | 8 +++++---
extensions/terraform/languages/terraform/indents.scm | 8 +++++---
5 files changed, 17 insertions(+), 9 deletions(-)
Detailed changes
@@ -12,3 +12,4 @@ brackets = [
{ start = "'", end = "'", close = true, newline = false, not_in = ["comment", "string"] },
{ start = "/*", end = " */", close = true, newline = false, not_in = ["comment", "string"] },
]
+tab_size = 2
@@ -6,6 +6,8 @@
(function_call)
] @indent
-(_ "[" "]" @end) @indent
-(_ "(" ")" @end) @indent
-(_ "{" "}" @end) @indent
+[
+ "]"
+ "}"
+ ")"
+] @outdent
@@ -12,3 +12,4 @@ brackets = [
{ start = "'", end = "'", close = true, newline = false, not_in = ["comment", "string"] },
{ start = "/*", end = " */", close = true, newline = false, not_in = ["comment", "string"] },
]
+tab_size = 2
@@ -6,9 +6,11 @@
(function_call)
] @indent
-(_ "[" "]" @end) @indent
-(_ "(" ")" @end) @indent
-(_ "{" "}" @end) @indent
+[
+ "]"
+ "}"
+ ")"
+] @outdent
; https://github.com/nvim-treesitter/nvim-treesitter/blob/ce4adf11cfe36fc5b0e5bcdce0c7c6e8fbc9798a/queries/terraform/indents.scm
; inherits: hcl
@@ -6,9 +6,11 @@
(function_call)
] @indent
-(_ "[" "]" @end) @indent
-(_ "(" ")" @end) @indent
-(_ "{" "}" @end) @indent
+[
+ "]"
+ "}"
+ ")"
+] @outdent
; https://github.com/nvim-treesitter/nvim-treesitter/blob/ce4adf11cfe36fc5b0e5bcdce0c7c6e8fbc9798a/queries/terraform/indents.scm
; inherits: hcl