(class_declaration
    "class" @context
    name: (name) @name
    ) @item

(function_definition
    "function" @context
    name: (_) @name
    ) @item

(method_declaration
    "function" @context
    name: (_) @name
    ) @item

(interface_declaration
    "interface" @context
    name: (_) @name
    ) @item

(enum_declaration
    "enum" @context
    name: (_) @name
    ) @item

(trait_declaration
    "trait" @context
    name: (_) @name
    ) @item
