aboutsummaryrefslogtreecommitdiffstats
path: root/queries/swift
diff options
context:
space:
mode:
authorPham Huy Hoang <hoangtun0810@gmail.com>2023-05-19 00:57:18 +0900
committerGitHub <noreply@github.com>2023-05-19 00:57:18 +0900
commit1aea2eee29b43c7ac42aa7487082d1163cd433e3 (patch)
treeb7c92dbc17495cc9683c966af2475a98a8cab3b8 /queries/swift
parentUpdate parsers: c_sharp, erlang, glsl, hlsl, nickel, t32 (diff)
downloadnvim-treesitter-1aea2eee29b43c7ac42aa7487082d1163cd433e3.tar
nvim-treesitter-1aea2eee29b43c7ac42aa7487082d1163cd433e3.tar.gz
nvim-treesitter-1aea2eee29b43c7ac42aa7487082d1163cd433e3.tar.bz2
nvim-treesitter-1aea2eee29b43c7ac42aa7487082d1163cd433e3.tar.lz
nvim-treesitter-1aea2eee29b43c7ac42aa7487082d1163cd433e3.tar.xz
nvim-treesitter-1aea2eee29b43c7ac42aa7487082d1163cd433e3.tar.zst
nvim-treesitter-1aea2eee29b43c7ac42aa7487082d1163cd433e3.zip
refactor: add notes for swift
Also add enum_class_body
Diffstat (limited to 'queries/swift')
-rw-r--r--queries/swift/indents.scm39
1 files changed, 22 insertions, 17 deletions
diff --git a/queries/swift/indents.scm b/queries/swift/indents.scm
index 4207a788b..39ad59405 100644
--- a/queries/swift/indents.scm
+++ b/queries/swift/indents.scm
@@ -1,16 +1,18 @@
[
- (protocol_body)
- (class_body)
- (function_declaration)
- (computed_property)
- (subscript_declaration)
+ ; ... refers to the section that will get affected by this indent.begin capture
+ (protocol_body) ; protocol Foo { ... }
+ (class_body) ; class Foo { ... }
+ (enum_class_body) ; enum Foo { ... }
+ (function_declaration) ; func Foo (...) {...}
+ (computed_property) ; { ... }
+ (subscript_declaration) ; subscript Foo(...) { ... }
- (computed_getter)
- (computed_setter)
+ (computed_getter) ; get { ... }
+ (computed_setter) ; set { ... }
- (assignment)
+ (assignment) ; a = b
- (control_transfer_statement) ; return ...
+ (control_transfer_statement) ; return ...
(for_statement)
(while_statement)
(repeat_while_statement)
@@ -19,15 +21,15 @@
(switch_statement)
(guard_statement)
- (type_parameters) ; x<Foo>
- (tuple_type) ; (...)
- (array_type) ; [String]
- (dictionary_type); [Foo: Bar]
+ (type_parameters) ; x<Foo>
+ (tuple_type) ; (...)
+ (array_type) ; [String]
+ (dictionary_type) ; [Foo: Bar]
- (call_expression)
- (tuple_expression)
- (array_literal)
- (dictionary_literal)
+ (call_expression) ; callFunc(...)
+ (tuple_expression) ; ( foo + bar )
+ (array_literal) ; [ foo, bar ]
+ (dictionary_literal) ; [ foo: bar, x: y ]
(lambda_literal)
] @indent.begin
@@ -59,6 +61,9 @@
(if_statement
(if_statement) @indent.dedent)
+; case Foo:
+; default Foo:
+; @attribute default Foo:
(switch_entry . _ @indent.branch)
(function_declaration ")" @indent.branch)