(source_file) @local.scope
(block) @local.scope
(class_body) @local.scope
(trait_body) @local.scope

(function_declaration
  name: (identifier) @local.definition.function) @local.scope

(method_declaration
  name: (identifier) @local.definition.method) @local.scope

(class_declaration
  name: (binding_identifier) @local.definition.type) @local.scope

(trait_declaration
  name: (binding_identifier) @local.definition.type) @local.scope

(parameter
  name: (binding_identifier) @local.definition.parameter)

(variable_declaration
  name: (binding_identifier) @local.definition.var)

(field_declaration
  name: (identifier) @local.definition.field)

(for_statement
  name: (identifier) @local.definition.var)

(identifier) @local.reference
