diff options
| -rw-r--r-- | queries/gleam/indents.scm | 2 | ||||
| -rw-r--r-- | tests/indent/gleam/anonymous_function.gleam | 7 | ||||
| -rw-r--r-- | tests/indent/gleam_spec.lua | 8 |
3 files changed, 16 insertions, 1 deletions
diff --git a/queries/gleam/indents.scm b/queries/gleam/indents.scm index 9bfd2952b..0eef75129 100644 --- a/queries/gleam/indents.scm +++ b/queries/gleam/indents.scm @@ -1,5 +1,6 @@ ; Gleam indents similar to Rust and JavaScript [ + (anonymous_function) (assert) (case) (case_clause) @@ -11,7 +12,6 @@ (let) (list) (constant) - (external_function) (function) (type_definition) (type_alias) diff --git a/tests/indent/gleam/anonymous_function.gleam b/tests/indent/gleam/anonymous_function.gleam new file mode 100644 index 000000000..bcbdc2394 --- /dev/null +++ b/tests/indent/gleam/anonymous_function.gleam @@ -0,0 +1,7 @@ +fn() { + fn() { + fn() { + True + } + } +} diff --git a/tests/indent/gleam_spec.lua b/tests/indent/gleam_spec.lua index da0c86c57..8de57fd50 100644 --- a/tests/indent/gleam_spec.lua +++ b/tests/indent/gleam_spec.lua @@ -115,5 +115,13 @@ describe("indent Gleam:", function() run:new_line("todo.gleam", { on_line = 3, text = "//", indent = 4 }) run:new_line("todo.gleam", { on_line = 4, text = "//", indent = 2 }) run:new_line("todo.gleam", { on_line = 5, text = "//", indent = 0 }) + + run:new_line("anonymous_function.gleam", { on_line = 1, text = "//", indent = 2 }) + run:new_line("anonymous_function.gleam", { on_line = 2, text = "//", indent = 4 }) + run:new_line("anonymous_function.gleam", { on_line = 3, text = "//", indent = 6 }) + run:new_line("anonymous_function.gleam", { on_line = 4, text = "//", indent = 6 }) + run:new_line("anonymous_function.gleam", { on_line = 5, text = "//", indent = 4 }) + run:new_line("anonymous_function.gleam", { on_line = 6, text = "//", indent = 2 }) + run:new_line("anonymous_function.gleam", { on_line = 7, text = "//", indent = 0 }) end) end) |
