Class: RubyLsp::Xlsxrb::Addon

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

Overview

Ruby LSP Add-on for xlsxrb.

[Context & Lifecycle Note] This add-on serves as a bridge/polyfill for current Ruby LSP environments. While xlsxrb ships with complete RBS signatures (sig/generated/), Ruby LSP's type inferrer does not yet perform automatic static type inference from method block signatures to block parameters (e.g., Xlsxrb.generate do |wb|).

This add-on enables immediate out-of-the-box autocompletion and rich Markdown documentation across all public block arguments.

As the Ruby tooling ecosystem evolves and Ruby LSP gains native block argument type resolution from gem RBS signatures in the future, this add-on will become redundant and can eventually be deprecated or removed.

Instance Method Summary collapse

Instance Method Details

#activate(global_state, _message_queue) ⇒ Object



24
25
26
# File 'lib/ruby_lsp/xlsxrb/addon.rb', line 24

def activate(global_state, _message_queue)
  @global_state = global_state
end

#create_completion_listener(response_builder, node_context, dispatcher, _uri = nil) ⇒ Object



38
39
40
# File 'lib/ruby_lsp/xlsxrb/addon.rb', line 38

def create_completion_listener(response_builder, node_context, dispatcher, _uri = nil)
  CompletionListener.new(response_builder, node_context, dispatcher, @global_state)
end

#deactivateObject



28
# File 'lib/ruby_lsp/xlsxrb/addon.rb', line 28

def deactivate; end

#nameObject



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

def name
  "xlsxrb"
end

#versionObject



34
35
36
# File 'lib/ruby_lsp/xlsxrb/addon.rb', line 34

def version
  ::Xlsxrb::VERSION
end