lib/solargraph/language_server/host.rb
# Start processing a request from the client. After the message is
# processed, the transport is responsible for sending the response.
#
# @param request [Hash] The contents of the message.
# @return [Solargraph::LanguageServer::Message::Base] The message handler.
Start processing a request from the client. After the message is
processed, the transport is responsible for sending the response.
Start processing a request from the client . After the message is processed the transport is responsible for sending the response .
def receive request
        if request['method']
          logger.info "Server received #{request['method']}"
          logger.debug request
          message = Message.select(request['method']).new(self, request)
          begin
            message.process
          rescue Exception => e
            logger.warn "Error processing request: [#{e.class}] #{e.message}"
            logger.warn e.backtrace
            message.set_error Solargraph::LanguageServer::ErrorCodes::INTERNAL_ERROR, "[#{e.class}] #{e.message}"
          end
          message
        elsif request['id']
          requests[request['id']].process(request['result'])
          requests.delete request['id']
        else
          logger.warn "Invalid message received."
          logger.debug request
        end
      end
def receive request if request [ 'method' ] logger . info "Server received #{request['method']}" logger . debug request message = Message . select ( request [ 'method' ] ) . new ( self , request ) begin message . process rescue Exception => e logger . warn "Error processing request: [#{e.class}] #{e.message}" logger . warn e . backtrace message . set_error Solargraph :: LanguageServer :: ErrorCodes :: INTERNAL_ERROR , "[#{e.class}] #{e.message}" end message elsif request [ 'id' ] requests [ request [ 'id' ] ] . process ( request [ 'result' ] ) requests . delete request [ 'id' ] else logger . warn "Invalid message received." logger . debug request end end
Start processing a request from the client.
Start processing a request from the client .
# @todo What if the id is invalid?
The message handler.
The message handler .
Solargraph::LanguageServer::Message::Base
request
The contents of the message.
The contents of the message .