You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
The "remote plugin" concept is too complicated. neovim/neovim#27949
Solution:
- Let the "client" also be the "host". Eliminate the separate "host"
concept and related modules.
- Let any node module be a "host". Any node module that imports the
"neovim" package and defines mappings from a method name => function,
is a "remote module". It can be loaded by Nvim as a regular "node
client" which also responds to requests.
TEST CASE / DEMO:
const found = findNvim({ orderBy: 'desc', minVersion: '0.9.0' })
const nvim_proc = child_process.spawn(found.matches[0].path, ['--clean', '--embed'], {});
const nvim = attach({ proc: nvim_proc });
nvim.setHandler('foo', (ev, args) => {
nvim.logger.info('handled from remote module: "%s": args:%O', ev.name, args);
});
nvim.callFunction('rpcrequest', [(await nvim.channelId), 'foo', [42, true, 'bar']]);
2024-03-26 16:47:35 INF handleRequest: foo
2024-03-26 16:47:35 DBG request received: foo
2024-03-26 16:47:35 INF handled from remote module: "foo": args:[ [ 42, true, 'bar' ] ]
0 commit comments