Module: RubyLsp::Refactor::CodeActionsExtension

Defined in:
lib/ruby_lsp/ruby_lsp_refactor/addon.rb

Overview

Prepended into RubyLsp::Requests::CodeActions#perform.

Runs our own AST walk and appends the resulting actions to whatever ruby-lsp itself returns. Each action carries a full ‘edit:` so no resolve round-trip is needed (the LSP spec allows this).

Instance Method Summary collapse

Instance Method Details

#performObject



40
41
42
43
44
# File 'lib/ruby_lsp/ruby_lsp_refactor/addon.rb', line 40

def perform
  actions = super || []
  actions.concat(RubyLsp::Refactor::Addon.refactor_actions_for(@document, @range))
  actions
end