class TypeProf::LSP::Reader
公共类方法
new(io) 点击切换源代码
# File typeprof-0.30.1/lib/typeprof/lsp/server.rb, line 171 def initialize(io) @io = io end
公共实例方法
read() { |json| ... } 点击切换源代码
# File typeprof-0.30.1/lib/typeprof/lsp/server.rb, line 175 def read while line = @io.gets line2 = @io.gets if line =~ /\AContent-length: (\d+)\r\n\z/i && line2 == "\r\n" len = $1.to_i json = JSON.parse(@io.read(len), symbolize_names: true) yield json else raise ProtocolError, "LSP broken header" end end end