Class: RubyLsp::Handler
- Inherits:
-
Object
- Object
- RubyLsp::Handler
- Extended by:
- T::Sig
- Defined in:
- lib/ruby_lsp/handler.rb
Constant Summary collapse
- VOID =
T.let(Object.new.freeze, Object)
- Interface =
LanguageServer::Protocol::Interface
- Constant =
LanguageServer::Protocol::Constant
- Transport =
LanguageServer::Protocol::Transport
Instance Attribute Summary collapse
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
- #config(&blk) ⇒ Object
-
#initialize ⇒ Handler
constructor
A new instance of Handler.
- #start ⇒ Object
Constructor Details
#initialize ⇒ Handler
21 22 23 24 25 26 |
# File 'lib/ruby_lsp/handler.rb', line 21 def initialize @writer = T.let(Transport::Stdio::Writer.new, Transport::Stdio::Writer) @reader = T.let(Transport::Stdio::Reader.new, Transport::Stdio::Reader) @handlers = T.let({}, T::Hash[String, T.proc.params(request: T::Hash[Symbol, T.untyped]).returns(T.untyped)]) @store = T.let(Store.new, Store) end |
Instance Attribute Details
#store ⇒ Object (readonly)
Returns the value of attribute store.
14 15 16 |
# File 'lib/ruby_lsp/handler.rb', line 14 def store @store end |
Instance Method Details
#config(&blk) ⇒ Object
35 36 37 |
# File 'lib/ruby_lsp/handler.rb', line 35 def config(&blk) instance_exec(&blk) end |
#start ⇒ Object
29 30 31 32 |
# File 'lib/ruby_lsp/handler.rb', line 29 def start $stderr.puts "Starting Ruby LSP..." @reader.read { |request| handle(request) } end |