aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/provider/ruby.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-03-11 12:33:41 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-03-11 12:33:41 -0500
commit66a75fb835575b7a909102cf2345e132648935a6 (patch)
tree1f7bc7f59f46e3d5c247b3cc22018e56f520b3c8 /runtime/autoload/provider/ruby.vim
parent26d189e9a1d50df6878e818f7ad0a981f9bd5d82 (diff)
parent3cb9970acf935c1b8627cfd244757b68989ad146 (diff)
downloadrneovim-66a75fb835575b7a909102cf2345e132648935a6.tar.gz
rneovim-66a75fb835575b7a909102cf2345e132648935a6.tar.bz2
rneovim-66a75fb835575b7a909102cf2345e132648935a6.zip
Merge pull request #4410 from alexgenco/ruby_rplugin
Ruby remote plugin support
Diffstat (limited to 'runtime/autoload/provider/ruby.vim')
-rw-r--r--runtime/autoload/provider/ruby.vim34
1 files changed, 34 insertions, 0 deletions
diff --git a/runtime/autoload/provider/ruby.vim b/runtime/autoload/provider/ruby.vim
new file mode 100644
index 0000000000..aad8c09d28
--- /dev/null
+++ b/runtime/autoload/provider/ruby.vim
@@ -0,0 +1,34 @@
+" The Ruby provider helper
+if exists('s:loaded_ruby_provider')
+ finish
+endif
+
+let s:loaded_ruby_provider = 1
+
+function! provider#ruby#Require(host) abort
+ " Collect registered Ruby plugins into args
+ let args = []
+ let ruby_plugins = remote#host#PluginsForHost(a:host.name)
+
+ for plugin in ruby_plugins
+ call add(args, plugin.path)
+ endfor
+
+ try
+ let channel_id = rpcstart(provider#ruby#Prog(), args)
+
+ if rpcrequest(channel_id, 'poll') == 'ok'
+ return channel_id
+ endif
+ catch
+ echomsg v:throwpoint
+ echomsg v:exception
+ endtry
+
+ throw remote#host#LoadErrorForHost(a:host.orig_name,
+ \ '$NVIM_RUBY_LOG_FILE')
+endfunction
+
+function! provider#ruby#Prog() abort
+ return 'neovim-ruby-host'
+endfunction