Module: Neovim::RubyProvider Private
- Defined in:
- lib/neovim/ruby_provider.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
This class is used to define a Neovim::Plugin to act as a backend for the :ruby, :rubyfile, and :rubydo Vim commands. It is autoloaded from nvim and not intended to be required directly.
Class Method Summary collapse
- .__define_plugin! ⇒ Object private
-
.__define_setup(plug) ⇒ Object
private
Bootstrap the provider client:.
Class Method Details
.__define_plugin! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/neovim/ruby_provider.rb', line 12 def self.__define_plugin! Thread.abort_on_exception = true Neovim.plugin do |plug| __define_setup(plug) __define_ruby_execute(plug) __define_ruby_execute_file(plug) __define_ruby_do_range(plug) __define_ruby_chdir(plug) end end |
.__define_setup(plug) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Bootstrap the provider client:
-
Monkeypatch $stdout and $stderr to write to
nvim. -
Define the
DirChangedevent to update the provider’s pwd.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/neovim/ruby_provider.rb', line 28 def self.__define_setup(plug) plug.__send__(:setup) do |client| begin cid = client.api.channel_id client.command("au DirChanged * call rpcrequest(#{cid}, 'ruby_chdir', v:event)") rescue ArgumentError # Swallow this exception for now. This means the nvim installation is # from before DirChanged was implemented. end end end |