<commit_before>require "neovim/logging"
require "neovim/event_loop/connection"
require "neovim/event_loop/message_builder"
require "neovim/event_loop/serializer"

module Neovim
  class EventLoop
    include Logging

    # Connect to a TCP socket.
    def self.tcp(host, port)
      new Connection.tcp(host, port)
    end

    # Connect to a UNIX domain socket.
    def self.unix(path)
      new Connection.unix(path)
    end

    # Spawn and connect to a child +nvim+ process.
    def self.child(argv)
      new Connection.child(argv)
    end

    # Connect to the current process's standard streams. This is used to
    # promote the current process to a Ruby plugin host.
    def self.stdio
      new Connection.stdio
    end

    def initialize(connection)
      @running = false
      @shutdown = false
      @connection = connection
      @serializer = Serializer.new
      @message_builder = MessageBuilder.new
    end

    def stop
      @running = false
    end

    def shutdown
      stop
      @shutdown = true
    end

    def request(method, *args, &response_handler)
      log(:debug) { {:name => method, :arguments => arg} }
      write(:request, method, args, response_handler)
    end<commit_msg>Fix typo in log line<commit_after>require "neovim/logging"
require "neovim/event_loop/connection"
require "neovim/event_loop/message_builder"
require "neovim/event_loop/serializer"

module Neovim
  class EventLoop
    include Logging

    # Connect to a TCP socket.
    def self.tcp(host, port)
      new Connection.tcp(host, port)
    end

    # Connect to a UNIX domain socket.
    def self.unix(path)
      new Connection.unix(path)
    end

    # Spawn and connect to a child +nvim+ process.
    def self.child(argv)
      new Connection.child(argv)
    end

    # Connect to the current process's standard streams. This is used to
    # promote the current process to a Ruby plugin host.
    def self.stdio
      new Connection.stdio
    end

    def initialize(connection)
      @running = false
      @shutdown = false
      @connection = connection
      @serializer = Serializer.new
      @message_builder = MessageBuilder.new
    end

    def stop
      @running = false
    end

    def shutdown
      stop
      @shutdown = true
    end

    def request(method, *args, &response_handler)
      log(:debug) { {:name => method, :arguments => args} }
      write(:request, method, args, response_handler)
    end
{'fraction_non_alphanumeric': 0.07970419063270337, 'fraction_numerical': 0.0, 'mean_word_length': 2.6289120715350225, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '481704', 'n_tokens_mistral': 738, 'n_tokens_neox': 711, 'n_words': 229}