aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Manning <alex41290@gmail.com>2023-06-03 21:39:20 -0400
committerGitHub <noreply@github.com>2023-06-04 10:39:20 +0900
commitf84de0d6cd3199149c1c4c236b7267ce7b0775a2 (patch)
treec3a54fa7159429c932fdb12c5a1a91fc7640596c
parentfix(make/highlights): add `define` and operators (diff)
downloadnvim-treesitter-f84de0d6cd3199149c1c4c236b7267ce7b0775a2.tar
nvim-treesitter-f84de0d6cd3199149c1c4c236b7267ce7b0775a2.tar.gz
nvim-treesitter-f84de0d6cd3199149c1c4c236b7267ce7b0775a2.tar.bz2
nvim-treesitter-f84de0d6cd3199149c1c4c236b7267ce7b0775a2.tar.lz
nvim-treesitter-f84de0d6cd3199149c1c4c236b7267ce7b0775a2.tar.xz
nvim-treesitter-f84de0d6cd3199149c1c4c236b7267ce7b0775a2.tar.zst
nvim-treesitter-f84de0d6cd3199149c1c4c236b7267ce7b0775a2.zip
fix(gleam): minor indent fixes
-rw-r--r--queries/gleam/indents.scm2
-rw-r--r--tests/indent/gleam/anonymous_function.gleam7
-rw-r--r--tests/indent/gleam_spec.lua8
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)