Module: Yoda::Server::Providers

Defined in:
lib/yoda/server/providers.rb,
lib/yoda/server/providers/base.rb,
lib/yoda/server/providers/hover.rb,
lib/yoda/server/providers/signature.rb,
lib/yoda/server/providers/completion.rb,
lib/yoda/server/providers/definition.rb,
lib/yoda/server/providers/text_document_did_open.rb,
lib/yoda/server/providers/text_document_did_save.rb,
lib/yoda/server/providers/text_document_did_change.rb

Defined Under Namespace

Classes: Base, Completion, Definition, Hover, Signature, TextDocumentDidChange, TextDocumentDidOpen, TextDocumentDidSave

Constant Summary collapse

CLASSES =
[
  Completion,
  Definition,
  Hover,
  Signature,
  TextDocumentDidChange,
  TextDocumentDidOpen,
  TextDocumentDidSave,
].freeze

Class Method Summary collapse

Class Method Details

.build_provider(method:, notifier:, session:) ⇒ Class<Providers::Base>?

Parameters:

Returns:



29
30
31
# File 'lib/yoda/server/providers.rb', line 29

def build_provider(method:, notifier:, session:)
  find_provider_class(method)&.new(notifier: notifier, session: session)
end

.find_provider_class(method) ⇒ Class<Providers::Base>?

Parameters:

  • method (Symbol)

Returns:



35
36
37
# File 'lib/yoda/server/providers.rb', line 35

def find_provider_class(method)
  CLASSES.find { |provider_class| provider_class.provide?(method) }
end