123456789_123456789_123456789_123456789_123456789_

Class: TypeProf::LSP::Message

Constant Summary

Class Method Summary

Instance Method Summary

Constructor Details

.new(server, json) ⇒ Message

[ GitHub ]

  
# File 'lib/typeprof/lsp.rb', line 369

def initialize(server, json)
  @server = server
  @id = json[:id]
  @method = json[:method]
  @params = json[:params]
end

Class Method Details

.build_table

[ GitHub ]

  
# File 'lib/typeprof/lsp.rb', line 396

def self.build_table
  Classes.each {|klass| Table[klass::METHOD] = klass }
end

.find(method)

[ GitHub ]

  
# File 'lib/typeprof/lsp.rb', line 400

def self.find(method)
  Table[method]
end

.inherited(klass)

[ GitHub ]

  
# File 'lib/typeprof/lsp.rb', line 391

def self.inherited(klass)
  Classes << klass
end

Instance Method Details

#respond(result)

[ GitHub ]

  
# File 'lib/typeprof/lsp.rb', line 380

def respond(result)
  raise "do not respond to notification" if @id == nil
  @server.send_response(id: @id, result: result)
end

#respond_error(error)

[ GitHub ]

  
# File 'lib/typeprof/lsp.rb', line 385

def respond_error(error)
  raise "do not respond to notification" if @id == nil
  @server.send_response(id: @id, error: error)
end

#run

[ GitHub ]

  
# File 'lib/typeprof/lsp.rb', line 376

def run
  p [:ignored, @method]
end