Class: Kanayago::LSP::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/kanayago/lsp/server.rb

Overview

Language Server Protocol server for Kanayago

Instance Method Summary collapse

Constructor Details

#initialize(input: $stdin, output: $stdout) ⇒ Server

Returns a new instance of Server.



10
11
12
13
14
15
16
17
# File 'lib/kanayago/lsp/server.rb', line 10

def initialize(input: $stdin, output: $stdout)
  @input = input
  @output = output
  @writer = LanguageServer::Protocol::Transport::Io::Writer.new(@output)
  @reader = LanguageServer::Protocol::Transport::Io::Reader.new(@input)
  @diagnostics = DiagnosticsProvider.new
  @documents = {} # URI => content mapping
end

Instance Method Details

#startObject



19
20
21
22
23
# File 'lib/kanayago/lsp/server.rb', line 19

def start
  @reader.read do |request|
    handle_request(request)
  end
end