; Types

(namespace_declaration
  body: (declaration_list
    "{" @start
    "}" @end)
  (#set! role type))

(class_declaration
  body: (declaration_list
    "{" @start
    "}" @end)
  (#set! role type))

(interface_declaration
  body: (declaration_list
    "{" @start
    "}" @end)
  (#set! role type))

(struct_declaration
  body: (declaration_list
    "{" @start
    "}" @end)
  (#set! role type))

(enum_declaration
  body: (enum_member_declaration_list
    "{" @start
    "}" @end)
  (#set! role type))

; Functions

(local_function_statement
  body: (block
    "{" @start
    "}" @end)
  (#set! role function))

(constructor_declaration
  body: (block
    "{" @start
    "}" @end)
  (#set! role function))

(method_declaration
  body: (block
    "{" @start
    "}" @end)
  (#set! role function))

(lambda_expression
  body: (block
    "{" @start
    "}" @end)
  (#set! role function))

; Statements

(for_statement
  body: (block
    "{" @start
    "}" @end))
; Statements

(foreach_statement
  body: (block
    "{" @start
    "}" @end))

(while_statement
  body: (block
    "{" @start
    "}" @end))

(do_statement
  body: (block
    "{" @start
    "}" @end))

(if_statement
  consequence: (block
    "{" @start
    "}" @end))

(if_statement
  alternative: (block
    "{" @start
    "}" @end))

(try_statement
  body: (block
    "{" @start
    "}" @end))

(catch_clause
  body: (block
    "{" @start
    "}" @end))

(checked_statement
  (block
    "{" @start
    "}" @end))

(lock_statement
  (block
    "{" @start
    "}" @end))

(fixed_statement
  (block
    "{" @start
    "}" @end))

(using_statement
  body: (block
    "{" @start
    "}" @end))
