class TypeProf::LSP::Writer
Public Class Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/lsp/server.rb, line 283 def initialize(io) @io = io @mutex = Mutex.new end
Public Instance Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/lsp/server.rb, line 288 def write(**json) json = JSON.generate(json.merge(jsonrpc: "2.0")) @mutex.synchronize do @io << "Content-Length: #{ json.bytesize }\r\n\r\n" << json @io.flush end end