Class: RubyLsp::RubyLspRubyfmt::Addon

Inherits:
Addon
  • Object
show all
Defined in:
lib/ruby_lsp/ruby-lsp-rubyfmt/addon.rb

Instance Method Summary collapse

Instance Method Details

#activateObject



13
14
15
16
17
18
# File 'lib/ruby_lsp/ruby-lsp-rubyfmt/addon.rb', line 13

def activate
  # The first argument is an identifier users can pick to select this formatter. To use this formatter, users must
  # have rubyLsp.formatter configured to "rubyfmt"
  # The second argument is a singleton instance that implements the `FormatterRunner` interface (see below)
  RubyLsp::Requests::Formatting.register_formatter("rubyfmt", RubyFmtFormatterRunner.instance)
end

#deactivateObject



20
21
# File 'lib/ruby_lsp/ruby-lsp-rubyfmt/addon.rb', line 20

def deactivate
end

#nameObject



9
10
11
# File 'lib/ruby_lsp/ruby-lsp-rubyfmt/addon.rb', line 9

def name
  "Ruby Fmt Formatter"
end