mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 10:50:06 -04:00
refactor: add notes for swift
Also add enum_class_body
This commit is contained in:
parent
4d0520ee09
commit
1aea2eee29
1 changed files with 22 additions and 17 deletions
|
|
@ -1,16 +1,18 @@
|
||||||
[
|
[
|
||||||
(protocol_body)
|
; ... refers to the section that will get affected by this indent.begin capture
|
||||||
(class_body)
|
(protocol_body) ; protocol Foo { ... }
|
||||||
(function_declaration)
|
(class_body) ; class Foo { ... }
|
||||||
(computed_property)
|
(enum_class_body) ; enum Foo { ... }
|
||||||
(subscript_declaration)
|
(function_declaration) ; func Foo (...) {...}
|
||||||
|
(computed_property) ; { ... }
|
||||||
|
(subscript_declaration) ; subscript Foo(...) { ... }
|
||||||
|
|
||||||
(computed_getter)
|
(computed_getter) ; get { ... }
|
||||||
(computed_setter)
|
(computed_setter) ; set { ... }
|
||||||
|
|
||||||
(assignment)
|
(assignment) ; a = b
|
||||||
|
|
||||||
(control_transfer_statement) ; return ...
|
(control_transfer_statement) ; return ...
|
||||||
(for_statement)
|
(for_statement)
|
||||||
(while_statement)
|
(while_statement)
|
||||||
(repeat_while_statement)
|
(repeat_while_statement)
|
||||||
|
|
@ -19,15 +21,15 @@
|
||||||
(switch_statement)
|
(switch_statement)
|
||||||
(guard_statement)
|
(guard_statement)
|
||||||
|
|
||||||
(type_parameters) ; x<Foo>
|
(type_parameters) ; x<Foo>
|
||||||
(tuple_type) ; (...)
|
(tuple_type) ; (...)
|
||||||
(array_type) ; [String]
|
(array_type) ; [String]
|
||||||
(dictionary_type); [Foo: Bar]
|
(dictionary_type) ; [Foo: Bar]
|
||||||
|
|
||||||
(call_expression)
|
(call_expression) ; callFunc(...)
|
||||||
(tuple_expression)
|
(tuple_expression) ; ( foo + bar )
|
||||||
(array_literal)
|
(array_literal) ; [ foo, bar ]
|
||||||
(dictionary_literal)
|
(dictionary_literal) ; [ foo: bar, x: y ]
|
||||||
(lambda_literal)
|
(lambda_literal)
|
||||||
] @indent.begin
|
] @indent.begin
|
||||||
|
|
||||||
|
|
@ -59,6 +61,9 @@
|
||||||
(if_statement
|
(if_statement
|
||||||
(if_statement) @indent.dedent)
|
(if_statement) @indent.dedent)
|
||||||
|
|
||||||
|
; case Foo:
|
||||||
|
; default Foo:
|
||||||
|
; @attribute default Foo:
|
||||||
(switch_entry . _ @indent.branch)
|
(switch_entry . _ @indent.branch)
|
||||||
|
|
||||||
(function_declaration ")" @indent.branch)
|
(function_declaration ")" @indent.branch)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue