diff options
| author | kiyan <yazdani.kiyan@protonmail.com> | 2022-07-02 12:47:05 +0200 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-07-08 00:14:29 +0200 |
| commit | 6eb35103d08bbd35d9e7e3cd3987d85451c7e329 (patch) | |
| tree | 99d314e800b6d662f4c7d37cb6e5b115edd3688d /tests | |
| parent | Highlight named fields in struct literals (diff) | |
| download | nvim-treesitter-6eb35103d08bbd35d9e7e3cd3987d85451c7e329.tar nvim-treesitter-6eb35103d08bbd35d9e7e3cd3987d85451c7e329.tar.gz nvim-treesitter-6eb35103d08bbd35d9e7e3cd3987d85451c7e329.tar.bz2 nvim-treesitter-6eb35103d08bbd35d9e7e3cd3987d85451c7e329.tar.lz nvim-treesitter-6eb35103d08bbd35d9e7e3cd3987d85451c7e329.tar.xz nvim-treesitter-6eb35103d08bbd35d9e7e3cd3987d85451c7e329.tar.zst nvim-treesitter-6eb35103d08bbd35d9e7e3cd3987d85451c7e329.zip | |
fix(go): indent const declaration
https://github.com/nvim-treesitter/nvim-treesitter/issues/3104
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/indent/go/const_declaration.go | 7 | ||||
| -rw-r--r-- | tests/indent/go_spec.lua | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/indent/go/const_declaration.go b/tests/indent/go/const_declaration.go new file mode 100644 index 000000000..cc3c2e6a4 --- /dev/null +++ b/tests/indent/go/const_declaration.go @@ -0,0 +1,7 @@ +package main + +const ( + ExampleOne = iota + ExampleTwo + ExampleThree +) diff --git a/tests/indent/go_spec.lua b/tests/indent/go_spec.lua index 10e9763c9..4d604f3ef 100644 --- a/tests/indent/go_spec.lua +++ b/tests/indent/go_spec.lua @@ -15,11 +15,10 @@ describe("indent Go:", function() }) end) - describe("new line:", function() + describe("new lines:", function() run:new_line("issue-2369.go", { on_line = 13, text = "// some comment", indent = 1 }) - end) - - describe("new line after )/}:", function() run:new_line("issue-2369-newline.go", { on_line = 8, text = "// comment", indent = 0 }) + run:new_line("const_declaration.go", { on_line = 3, text = "Constant", indent = 1 }) + run:new_line("const_declaration.go", { on_line = 7, text = "func main() {", indent = 0 }) end) end) |
