Skip to content

[RFC] remote: add node host#7458

Merged
justinmk merged 3 commits intoneovim:masterfrom
billyvg:feat/add-node-host
Nov 11, 2017
Merged

[RFC] remote: add node host#7458
justinmk merged 3 commits intoneovim:masterfrom
billyvg:feat/add-node-host

Conversation

@billyvg
Copy link
Copy Markdown
Contributor

@billyvg billyvg commented Oct 29, 2017

This adds support for node.js as a remote host, also adds health check.

@billyvg billyvg changed the title remote: add node host (WIP) remote: add node host Oct 29, 2017
Comment thread runtime/autoload/provider/node.vim Outdated
let s:stderr = {}
let s:job_opts = {'rpc': v:true}

function! s:job_opts.on_stderr(chan_id, data, event)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

endif
call health#report_info('Host: '. host)

let latest_npm_cmd = has('win32') ? 'cmd /c npm info neovim --json' : 'npm info neovim --json'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not need a separate command for Windows, I believe the ruby check does it that way because of the different quoting. (Though it may possibly be unnecessary there as well, since system([...]) is called with a list.)

Copy link
Copy Markdown
Contributor

@janlazo janlazo Oct 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safe to use same command in Windows. Nevermind. npm.cmd calls npm node in the same directory. npm in Windows is a shell script.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same case for ruby, I think I recall.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This used ruby's provider script as a template)

@bfredl bfredl changed the title (WIP) remote: add node host [WIP] remote: add node host Oct 31, 2017
@bfredl bfredl added provider remote-plugin plugins as RPC coprocesses (node.js, python, etc) labels Oct 31, 2017
@marvim marvim added the WIP label Oct 31, 2017
@justinmk
Copy link
Copy Markdown
Member

justinmk commented Nov 9, 2017

@billyvg still WIP?

@billyvg
Copy link
Copy Markdown
Contributor Author

billyvg commented Nov 10, 2017

@justinmk Nope, I think it's good.

@justinmk justinmk changed the title [WIP] remote: add node host [RFC] remote: add node host Nov 11, 2017
@justinmk justinmk merged commit b6a603f into neovim:master Nov 11, 2017
@justinmk justinmk removed the WIP label Nov 11, 2017
return
endif

if !executable('node') || !executable('npm') || !executable('yarn')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is yarn a requirement, @billyvg ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, it shouldn't be, it seems I didn't pull in neovim/node-host@40c370a

justinmk added a commit to justinmk/neovim that referenced this pull request Nov 18, 2017
FEATURES:
b6a603f neovim#7458 node.js remote-plugin support
f5d4da0 :checkhealth : validate 'runtimepath' (neovim#7526)

FIXES:
e6beb60 :terminal : fix crash on resize (neovim#7547)
07931ed tui: 'guicursor': use DECSCUSR for xterm-likes (neovim#7576)
f185c73 neovim#7561 'os_open: UV_EINVAL on NULL filename'
e8af34d win: provider: Detect(): return *.cmd path (neovim#7577)
eacd788 :checkhealth : fix check for npm and yarn (neovim#7569)
a43a573 health.vim: normalize slashes for script path (neovim#7525)
69e3308 cmake: install runtime/rgb.txt
d0b05e3 runtime: Fix syntax error in `runtime/syntax/tex.vim` (neovim#7518)
55d8967 tutor: some fixes (neovim#7510)

CHANGES:
9837a9c remove legacy alias to `v:count` (neovim#7407)
c5f001a runtime: revert netrw update (neovim#7557)
67e4529 defaults: scrollback=10000 (neovim#7556)
881f9e4 process_close(): uv_unref() detached processes (neovim#7539)
justinmk added a commit to justinmk/neovim that referenced this pull request Nov 18, 2017
FEATURES:
a6de144 'viewoptions': add "curdir" flag neovim#7447
b6a603f node.js remote-plugin support neovim#7458
f5d4da0 :checkhealth : validate 'runtimepath' neovim#7526

FIXES:
e6beb60 :terminal : fix crash on resize neovim#7547
f19e5d6 work around gnome-terminal memory leak neovim#7573
07931ed 'guicursor': use DECSCUSR for xterm-likes neovim#7576
f185c73 'os_open: UV_EINVAL on NULL filename' neovim#7561
e8af34d win: provider: Detect(): return *.cmd path neovim#7577
eacd788 :checkhealth : fix check for npm and yarn neovim#7569
a43a573 health.vim: normalize slashes for script path neovim#7525
69e3308 cmake: install runtime/rgb.txt
d0b05e3 runtime: syntax error in `runtime/syntax/tex.vim` neovim#7518
55d8967 tutor: some fixes neovim#7510

CHANGES:
9837a9c remove legacy alias to `v:count` neovim#7407
c5f001a runtime: revert netrw update neovim#7557
67e4529 defaults: scrollback=10000 neovim#7556
881f9e4 process_close(): uv_unref() detached processes neovim#7539
@janlazo
Copy link
Copy Markdown
Contributor

janlazo commented Nov 28, 2017

@justinmk
Copy link
Copy Markdown
Member

justinmk commented Nov 28, 2017

@janlazo There aren't any. Would be nice to have a couple.

@janlazo
Copy link
Copy Markdown
Contributor

janlazo commented Nov 30, 2017

Any docs to refer to? There's no VimL sugar for node provider so I can't think of a test case for node_spec.lua

@janlazo
Copy link
Copy Markdown
Contributor

janlazo commented Nov 30, 2017

Is it impossible to write a one-liner test for node host through VimL?
The example in https://github.com/neovim/node-client#api-work-in-progress uses decorators but I don't have babel (neovim/node-client#43).

@justinmk
Copy link
Copy Markdown
Member

I don't know. Maybe @billyvg can comment.

@billyvg
Copy link
Copy Markdown
Contributor Author

billyvg commented Nov 30, 2017

@janlazo you can try the example mentioned here: neovim/node-client#43

@billyvg billyvg deleted the feat/add-node-host branch November 30, 2017 21:39
@janlazo
Copy link
Copy Markdown
Contributor

janlazo commented Nov 30, 2017

I tried that with some changes (run echo "Hello", not vsplit) but I couldn't register the command to rplugin.vim.
I placed the new file in %LOCALAPPDATA%\nvim\rplugin\node\hello.js (Windows user). rplugin.vim registers the file but it has no functions/commands attached to it.

willtn pushed a commit to willtn/neovim-config that referenced this pull request Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

provider remote-plugin plugins as RPC coprocesses (node.js, python, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants