Sha256: d997e9ccb71a20043c6822280e6f2c1e60ec51b5f292918f3b1b38fe5f56e2d8
Contents?: true
Size: 659 Bytes
Versions: 105
Compression:
Stored size: 659 Bytes
Contents
# frozen_string_literal: true require "json" module LanguageServer module Protocol module Transport module Io class Reader def initialize(io) @io = io io.binmode end def read(&block) while buffer = io.gets("\r\n\r\n") content_length = buffer.match(/Content-Length: (\d+)/i)[1].to_i message = io.read(content_length) or raise request = JSON.parse(message, symbolize_names: true) block.call(request) end end private attr_reader :io end end end end end
Version data entries
105 entries across 105 versions & 13 rubygems