Class: PlatformosCheck::LanguageServer::DocumentLinkEngine
- Inherits:
-
Object
- Object
- PlatformosCheck::LanguageServer::DocumentLinkEngine
- Defined in:
- lib/platformos_check/language_server/document_link_engine.rb
Instance Method Summary collapse
- #document_links(relative_path) ⇒ Object
-
#initialize(storage) ⇒ DocumentLinkEngine
constructor
A new instance of DocumentLinkEngine.
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
#document_links(relative_path) ⇒ Object
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 |