Class: RubyLsp::RubyLspSlim::Addon

Inherits:
Addon
  • Object
show all
Defined in:
lib/ruby_lsp/ruby_lsp_slim/addon.rb

Instance Method Summary collapse

Instance Method Details

#activate(global_state, outgoing_queue) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ruby_lsp/ruby_lsp_slim/addon.rb', line 10

def activate(global_state, outgoing_queue)
  @outgoing_queue = outgoing_queue

  RubyLsp::Store.prepend(StorePatch) unless RubyLsp::Store.ancestors.include?(StorePatch)
  RubyLsp::Server.prepend(ServerPatch) unless RubyLsp::Server.ancestors.include?(ServerPatch)

  register_slim_capability if global_state.client_capabilities.supports_watching_files

  outgoing_queue << Notification.window_log_message(
    "[Ruby LSP Slim] Addon v#{::RubyLspSlim::VERSION} activated",
    type: Constant::MessageType::INFO
  )
end

#deactivate ⇒ Object



24
# File 'lib/ruby_lsp/ruby_lsp_slim/addon.rb', line 24

def deactivate; end

#name ⇒ Object



26
27
28
# File 'lib/ruby_lsp/ruby_lsp_slim/addon.rb', line 26

def name
  "Ruby LSP Slim"
end

#version ⇒ Object



30
31
32
# File 'lib/ruby_lsp/ruby_lsp_slim/addon.rb', line 30

def version
  ::RubyLspSlim::VERSION
end