Sha256: 709b985595c6a323ad7f5eaee0fc4938390fa2a00fbbf7dfde40d993bb067664

Contents?: true

Size: 567 Bytes

Versions: 7

Compression:

Stored size: 567 Bytes

Contents

module LanguageServer
  module Protocol
    module Transport
      module Stdio
        class Writer
          def write(response)
            response_str = response.merge(
              jsonrpc: "2.0"
            ).to_json

            headers = {
              "Content-Length" => response_str.bytesize
            }

            headers.each do |k, v|
              STDOUT.print "#{k}: #{v}\r\n"
            end

            STDOUT.print "\r\n"

            STDOUT.print response_str
            STDOUT.flush
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
language_server-protocol-3.14.0.0 lib/language_server/protocol/transport/stdio/writer.rb
language_server-protocol-3.12.0.0 lib/language_server/protocol/transport/stdio/writer.rb
language_server-protocol-3.7.0.0 lib/language_server/protocol/transport/stdio/writer.rb
language_server-protocol-0.5.0 lib/language_server/protocol/transport/stdio/writer.rb
language_server-protocol-0.4.0 lib/language_server/protocol/transport/stdio/writer.rb
language_server-protocol-0.3.0 lib/language_server/protocol/transport/stdio/writer.rb
language_server-protocol-0.2.0 lib/language_server/protocol/transport/stdio/writer.rb