Class: Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/lsp/handler.rb

Constant Summary collapse

Interface =
LanguageServer::Protocol::Interface
Constant =
LanguageServer::Protocol::Constant

Instance Method Summary collapse

Constructor Details

#initializeHandler

Returns a new instance of Handler.



10
11
12
13
14
15
# File 'lib/rubocop/lsp/handler.rb', line 10

def initialize
  @writer = LanguageServer::Protocol::Transport::Stdio::Writer.new
  @reader = LanguageServer::Protocol::Transport::Stdio::Reader.new
  @handlers = {}
  @store = StateStore.new
end

Instance Method Details

#config(&blk) ⇒ Object



17
18
19
# File 'lib/rubocop/lsp/handler.rb', line 17

def config(&blk)
  instance_exec(&blk)
end

#startObject



21
22
23
24
25
# File 'lib/rubocop/lsp/handler.rb', line 21

def start
  reader.read do |request|
    handle(request)
  end
end