Module: Solargraph::LanguageServer::Transport::Adapter
- Defined in:
- lib/solargraph/language_server/transport/adapter.rb
Overview
A common module for running language servers in Backport.
Instance Method Summary collapse
Instance Method Details
#closing ⇒ Object
21 22 23 |
# File 'lib/solargraph/language_server/transport/adapter.rb', line 21 def closing @host.stop end |
#opening ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/solargraph/language_server/transport/adapter.rb', line 11 def opening @host = Solargraph::LanguageServer::Host.new @host.add_observer self @host.start @data_reader = Solargraph::LanguageServer::Transport::DataReader.new @data_reader. do || process end end |
#receiving(data) ⇒ Object
26 27 28 |
# File 'lib/solargraph/language_server/transport/adapter.rb', line 26 def receiving data @data_reader.receive data end |
#update ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/solargraph/language_server/transport/adapter.rb', line 30 def update if @host.stopped? shutdown else tmp = @host.flush write tmp unless tmp.empty? end end |