Module: Solargraph::LanguageServer::Message

Defined in:
lib/solargraph/language_server/message.rb,
lib/solargraph/language_server/message/base.rb,
lib/solargraph/language_server/message/client.rb,
lib/solargraph/language_server/message/extended.rb,
lib/solargraph/language_server/message/shutdown.rb,
lib/solargraph/language_server/message/workspace.rb,
lib/solargraph/language_server/message/initialize.rb,
lib/solargraph/language_server/message/initialized.rb,
lib/solargraph/language_server/message/text_document.rb,
lib/solargraph/language_server/message/cancel_request.rb,
lib/solargraph/language_server/message/completion_item.rb,
lib/solargraph/language_server/message/extended/search.rb,
lib/solargraph/language_server/message/method_not_found.rb,
lib/solargraph/language_server/message/exit_notification.rb,
lib/solargraph/language_server/message/extended/document.rb,
lib/solargraph/language_server/message/text_document/base.rb,
lib/solargraph/language_server/message/text_document/hover.rb,
lib/solargraph/language_server/message/extended/environment.rb,
lib/solargraph/language_server/message/extended/document_gems.rb,
lib/solargraph/language_server/message/extended/download_core.rb,
lib/solargraph/language_server/message/method_not_implemented.rb,
lib/solargraph/language_server/message/text_document/did_open.rb,
lib/solargraph/language_server/message/text_document/did_save.rb,
lib/solargraph/language_server/message/completion_item/resolve.rb,
lib/solargraph/language_server/message/text_document/did_close.rb,
lib/solargraph/language_server/message/text_document/completion.rb,
lib/solargraph/language_server/message/text_document/did_change.rb,
lib/solargraph/language_server/message/text_document/formatting.rb,
lib/solargraph/language_server/message/text_document/code_action.rb,
lib/solargraph/language_server/message/client/register_capability.rb,
lib/solargraph/language_server/message/extended/check_gem_version.rb,
lib/solargraph/language_server/message/text_document/folding_range.rb,
lib/solargraph/language_server/message/text_document/signature_help.rb,
lib/solargraph/language_server/message/text_document/on_type_formatting.rb

Overview

The Message namespace contains classes that implement language server protocol methods.

Defined Under Namespace

Modules: Client, CompletionItem, Extended, TextDocument, Workspace Classes: Base, CancelRequest, ExitNotification, Initialize, Initialized, MethodNotFound, MethodNotImplemented, Shutdown

Class Method Summary collapse

Class Method Details

.register(path, message_class) ⇒ void

This method returns an undefined value.

Register a method name and message for handling by the language server.

Examples:

Message.register 'initialize', Solargraph::Message::Initialize

Parameters:

  • path (String)

    The method name

  • message_class (Class<Message::Base>)

    The message class



34
35
36
# File 'lib/solargraph/language_server/message.rb', line 34

def register path, message_class
  method_map[path] = message_class
end

.select(path) ⇒ Class<Solargraph::LanguageServer::Message::Base>

Parameters:

  • path (String)

Returns:



40
41
42
43
44
45
46
47
48
# File 'lib/solargraph/language_server/message.rb', line 40

def select path
  if method_map.has_key?(path)
    method_map[path]
  elsif path.start_with?('$/')
    MethodNotImplemented
  else
    MethodNotFound
  end
end