mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 16:30:02 -04:00
feat(swift): add init/deinit indents
Signed-off-by: Phạm Huy Hoàng <hoangtun0810@gmail.com>
This commit is contained in:
parent
8d3176cfbc
commit
e73c775aa9
4 changed files with 25 additions and 5 deletions
|
|
@ -5,6 +5,8 @@
|
|||
(class_body) ; class Foo { ... }
|
||||
(enum_class_body) ; enum Foo { ... }
|
||||
(function_declaration) ; func Foo (...) {...}
|
||||
(init_declaration) ; init(...) {...}
|
||||
(deinit_declaration) ; deinit {...}
|
||||
(computed_property) ; { ... }
|
||||
(subscript_declaration) ; subscript Foo(...) { ... }
|
||||
|
||||
|
|
@ -37,6 +39,22 @@
|
|||
(didset_clause)
|
||||
] @indent.begin
|
||||
|
||||
(init_declaration) @indent.begin
|
||||
|
||||
(init_declaration
|
||||
[
|
||||
"init"
|
||||
"("
|
||||
] @indent.branch)
|
||||
|
||||
; indentation for init parameters
|
||||
(init_declaration
|
||||
")" @indent.branch @indent.end)
|
||||
|
||||
(init_declaration
|
||||
(parameter) @indent.begin
|
||||
(#set! indent.immediate))
|
||||
|
||||
; @something(...)
|
||||
(modifiers
|
||||
(attribute) @indent.begin)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue