class RubyIndexer::Collector
def handle_attribute(node, reader:, writer:)
def handle_attribute(node, reader:, writer:) arguments = node.arguments&.arguments return unless arguments receiver = node.receiver return unless receiver.nil? || receiver.is_a?(Prism::SelfNode) comments = collect_comments(node) arguments.each do |argument| name, loc = case argument when Prism::SymbolNode [argument.value, argument.value_loc] when Prism::StringNode [argument.content, argument.content_loc] end next unless name && loc @index << Entry::Accessor.new(name, @file_path, loc, comments, @current_owner) if reader @index << Entry::Accessor.new("#{name}=", @file_path, loc, comments, @current_owner) if writer end end