summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichał Kruszewski <mkru@protonmail.com>2020-09-04 20:21:35 +0200
committerMichał Kruszewski <mkru@protonmail.com>2020-09-07 21:48:06 +0200
commit0f63dd339aeba9c1d4cdc87d35d379c7af077797 (patch)
tree70e7b41982c54f88cf6d909c0848c348a639c0c3 /test
parent7d358e9ea1f759e8a4e42660dd901d2e0acd671d (diff)
Provide better support for Go language.
1. Highlight short variable declaration operator :=. 2. 'while' is not go keyword. 3. Auto insert ')', '}', when line ends with '(' or '{'.
Diffstat (limited to 'test')
-rw-r--r--test/indent/go/deindent-function-closing-brace/out3
-rw-r--r--test/indent/go/deindent-generic-closing-brace/in12
-rw-r--r--test/indent/go/deindent-generic-closing-brace/out19
-rw-r--r--test/indent/go/deindent-if-closing-brace/out3
4 files changed, 33 insertions, 4 deletions
diff --git a/test/indent/go/deindent-function-closing-brace/out b/test/indent/go/deindent-function-closing-brace/out
index 3a5e4869..cf5fd177 100644
--- a/test/indent/go/deindent-function-closing-brace/out
+++ b/test/indent/go/deindent-function-closing-brace/out
@@ -6,7 +6,8 @@ func foo(x int) int {
}
func foo(x int) int {
- bar()}
+ bar()
+}
func foo(x int) int {
bar()
diff --git a/test/indent/go/deindent-generic-closing-brace/in b/test/indent/go/deindent-generic-closing-brace/in
index 5a31c18f..ef741602 100644
--- a/test/indent/go/deindent-generic-closing-brace/in
+++ b/test/indent/go/deindent-generic-closing-brace/in
@@ -1,31 +1,43 @@
+1
{%( )}
+2
{%( )
}
+3
{%( )bar()}
+4
{%( )bar()
}
+5
{
bar()%( )}
+6
{
bar()%( )}
+7
{(%( ))}
+8
{(%( )
)}
+9
{(%( )foo())}
+10
{(%( )foo()
)}
+11
{(
bar()%( ))}
+12
{(
bar()%( ))}
diff --git a/test/indent/go/deindent-generic-closing-brace/out b/test/indent/go/deindent-generic-closing-brace/out
index cfd6db40..e3aaa065 100644
--- a/test/indent/go/deindent-generic-closing-brace/out
+++ b/test/indent/go/deindent-generic-closing-brace/out
@@ -1,43 +1,58 @@
+1
{
}
+2
{
}
+3
{
- bar()}
+ bar()
+}
+4
{
bar()
}
+5
{
bar()
}
+6
{
bar()
}
+7
{(
)}
+8
{(
)}
+9
{(
- foo())}
+ foo()
+)
+}
+10
{(
foo()
)}
+11
{(
bar()
)}
+12
{(
bar()
)}
diff --git a/test/indent/go/deindent-if-closing-brace/out b/test/indent/go/deindent-if-closing-brace/out
index 2c63bd1c..f133c197 100644
--- a/test/indent/go/deindent-if-closing-brace/out
+++ b/test/indent/go/deindent-if-closing-brace/out
@@ -6,7 +6,8 @@ if true {
}
if true {
- bar()}
+ bar()
+}
if true {
bar()