Class: PlatformosCheck::LanguageServer::DocumentLinkEngine

Inherits:
Object
  • Object
show all
Defined in:
lib/platformos_check/language_server/document_link_engine.rb

Instance Method Summary collapse

Constructor Details

#initialize(storage) ⇒ DocumentLinkEngine

Returns a new instance of DocumentLinkEngine.



6
7
8
9
# File 'lib/platformos_check/language_server/document_link_engine.rb', line 6

def initialize(storage)
  @storage = storage
  @providers = DocumentLinkProvider.all.map { |x| x.new(storage) }
end

Instance Method Details



11
12
13
14
15
16
17
18
# File 'lib/platformos_check/language_server/document_link_engine.rb', line 11

def document_links(relative_path)
  buffer = @storage.read(relative_path)
  return [] unless buffer

  @providers.flat_map do |p|
    p.document_links(buffer, @storage.platformos_app)
  end
end