nvim-parinfer.js
nvim-parinfer.js copied to clipboard
Does not work with latest version of node-host
When I run it with the latest version of node-host (v1.0.0) I get Unknown function: ParinferIndent
. Downgrading back to v0.0.1 fixes the problem.
https://github.com/neovim/node-host/commit/0c116cb3b48af7debe8d6bbaa35dcab064d58fb9 mentions that breaking changes are incoming, so it looks like whatever changes they made broke this plugin.
Are there any plans to support the new node-host or should I just stay on v0.0.1 for now?
I'm still debating between 1.0.0 and contributing to https://github.com/clojure-vim/neovim-client to allow hosting.
Is anyone using plugins that require node-host 1.0.0?
v1.0.0 was only released 10 days ago, so there probably aren't any plugins that rely on it currently. I'm using quite a bit plugins and this is the only one I have that relies on node-host, so I can personally stay on v0.0.1 for as long as I want.
I downgraded node-host but I'm not unable to get :UpdateRemotePlugins
to work, @Kelvin-Chen did you run into the same issue per chance?
@diffractometer I did not run into any issues with downgrading. Did you run npm install
in the node-host directory?
@Kelvin-Chen Thanks! That worked! Derp, I should have tried that. 🍻 <~ on me. Cheers.
@snoe I'm not using any plugins which require node-host 1.0.0.
I have this issue and honestly I think I've tried all combinations of all the random weird commands one should perform. I even tried downgrading node-host. All I get is just:
Error detected while processing function <SNR>17_indentparen:
line 8:
E117: Unknown function: ParinferIndent
E15: Invalid expression: ParinferIndent()
line 10:
E121: Undefined variable: lines
E116: Invalid arguments for function empty(lines)
I was able to undo the breaking changes, but with quite a bit of fiddling. I'm using vim-plugged
to install my dependencies, which only seemed to download the latest HEAD
. So when I define my plugins like:
call plug#begin('~/.vim/plugged')
Plug 'neovim/node-host'
call plug#end()
I don't seem to get the full git repository; I run git log --pretty=oneline
and only get the latest commit:
d6de4e79bed0c71e74380e7b11cafaa1a0e9c055 Merge pull request #31 from neovim/fix/health-check-requiring-yarn
So my first thought was to wipe away what vim-plugged
downloaded, and clone manually:
$ cd ~/.vim/plugged/
$ rm -rf node-host
$ git clone https://github.com/neovim/node-host
Next I checked out the reference to the non-breaking build, and installed its dependencies:
$ cd node-host
$ git checkout 0c116cb3b48af7debe8d6bbaa35dcab064d58fb9 .
$ npm install
This only fixed part of the problem, though. It seems there's a global dependency on node-host
that must be resolved as well. I'm unsure why, but doing npm install -g [email protected]
fails as the module cannot be found.
So I took a shot in the dark and moved the node-host
module from ~/.vim/plugged/
to /usr/local/lib/node_modules/
:
$ rm -rf /usr/local/lib/node_modules/node-host
$ cp -R ~/.vim/plugged/node-host /usr/local/lib/node_modules/
Afterwards opening vim and running :UpdateRemotePlugins
seems to have restored parinfer back to a stable condition! I can't guarantee this works on other workstations, but I thought I'd share in case someone ends up here from Google.
All you need to do is cd to plugged/node-host, git checkout v0.0.1, npm install, restart vim and run :UpdateRemotePlugins.
@snoe This is the only plugin I'm using with node-host
.
Is anyone using plugins that require node-host 1.0.0?
not even node-host
@snoe Since this is a plugin not only for Clojure development, and node-host has been merged into neovim, I think it's better to support node-host than clojure-vim/neovim-client
.
@markx Unfortunately, it looks like we're still stuck with node-client and it's dependency tree. You're right though, and I think it's a good time to bring this plugin back inline with everything.
Ok I think I've got things updated to run with the HEAD version of neovim.
I removed node-host from my plugins dir
I brew install --head neovim
I updated this plugin
I updated node to 8.9.1
I ran brew install -g neovim
Reran :UpdateRemotePlugins
and restarted neovim
Parinfer seemed to be working.
I'd like at least one person to confirm things look ok for them before closing this off.
Thanks for your patience.
It doesn't work for me, yet.
- Updated neovim to NVIM v0.2.2-38-gf8d40e7d5
- removed node-host directiory
- updated node to 8,9.1
- npm install -g neovim
- :UpdateRemotePlugins
Neovim doesn't have the Node provider available, I made created an issue in neovim
I created an issue with neovim, but there seems to be a bug in CheckHealth
If I run: :PlugInstall
remote/host: python3 host registered plugins ['denite', 'deoplete']
remote/host: generated rplugin manifest: /home/arjen/.local/share/nvim/rplugin.vim
function remote#host#UpdateRemotePlugins[6]..<SNR>18_RegistrationCommands[13]..remote#host#RegisterPlugin, line 5
Plugin "/home/arjen/config/dotfiles/_neovim/bundle/nvim-parinfer.js/rplugin/node/nvim-parinfer.js" is already registered
remote/host: python3 host registered plugins ['denite', 'deoplete']
remote/host: generated rplugin manifest: /home/arjen/.local/share/nvim/rplugin.vim
It looks like nvim-parinfer is installed.
If i open a lisp file and go into insert mode I get:
Error detected while processing function <SNR>49_process:
line 7:
E117: Unknown function: ParinferProcessEvent
Error detected while processing function <SNR>49_process:
line 7:
E15: Invalid expression: ParinferProcessEvent(l:event)
Error detected while processing function <SNR>49_process:
line 8:
E121: Undefined variable: l:result
Error detected while processing function <SNR>49_process:
line 8:
E116: Invalid arguments for function empty
Error detected while processing function <SNR>49_process:
line 8:
E15: Invalid expression: !empty(l:result)
@duikboot try to npm install -g yarn
the neovim node host comments suggest that was an oversight left in checkhealth
After updating everything, I also see these errors:
line 7:
E117: Unknown function: ParinferProcessEvent
E15: Invalid expression: ParinferProcessEvent(l:event)
line 8:
E121: Undefined variable: l:result
E116: Invalid arguments for function empty
E15: Invalid expression: !empty(l:result)
~~I was able to install the plugin using nvim v0.2.2 via homebrew HEAD. If it installs successfully you should see:~~
remote/host: node host registered plugins ['nvim-parinfer.js', 'jest']
~~Try removing the plugin, :UpdateRemotePlugins
, re-add to your vimrc and then run :PlugInstall
and :UpdateRemotePlugins
again.~~
I get errors in insert mode and it appears that plugin commands/functions aren't registering, will investigate.
Update: OK I see what the issue is, it depends on the neovim
package. change rplugin/node/nvim-parinfer.js
to a directory and add a package.json that has neovim
as a dependency. We will probably want to move these plugin decorators into a new package, here is the tracking issue: https://github.com/neovim/node-client/issues/42
Still doesn't work for me
It doesn't work yet on Fedora 26. CheckHealth still gives me:
## Node provider (optional)
- WARNING: `node` and `npm` must be in $PATH.
- ADVICE:
- Install Node.js and verify that `node` and `npm` commands work.
which node
and which npm
give me the correct path.
$ vim --version
NVIM v0.2.2-38-gf8d40e7d5
Build type: RelWithDebInfo
@billyvg thanks for helping with this.
What should cause the package.json
dependencies to be pulled in?
:UpdateRemotePlugins
doesn't seem to npm install and, as a user, I think I would need the dependencies at that point.
If there was a single neovim-client file (or es6 module) I could bring it in in the same way as I bring in parinfer. Unfortunately the nested requires aren't supported by cljs https://clojurescript.org/reference/javascript-module-support#node.js-module.
In the meantime @duikboot I think you can run lein npm install
in the root directory, and then NVIM_NODE_LOG_FILE=/tmp/nvim.log nvim
and :UpdateRemotePlugins
again. If that still fails, can you give the output of /tmp/nvim.log
?
@billyvg I pushed a branch called package
with your suggestion but I think it still requires the user to npm install
in that rplugin/node/nvim-parinfer
I had the same issue w.r.t Unknown function: ParinferProcessEvent
errors and the like. I went to the root directory and executed lein npm install
, and now it works.
I'm assuming that this is just a workaround?
@snoe It works now, I also had to add the node-modules bin directory to my $PATH
Thanks a lot
Is this issue still happening on neovim HEAD?
https://github.com/neovim/neovim/blob/master/test/functional/provider/nodejs_spec.lua explicity sets NODE_PATH
environment variable for require()
to work on global modules.
Ik works for me
@cbcoutinho I also fixed by lein npm install
, thanks.
I get the same error as soon as a clj file is opened.
- NVIM v0.2.3-413-g911b1e4 (Build type: Release)
- Node 8.9.4
- npm 5.6.0
- Ubuntu
What is lein npm install
supposed to do, 'npm' is not a task.
?
npm
is the Node Package Manager, used mainly for javascript projects. Leiningen
is a tool to build clojure
projects [0], but is also able to import clojurescript/javascript functionality - hence the lein
call to npm
. The command lein npm install
will run npm install
through Leiningen
.
I don't have enough knowledge about Clojure/Javascript/ClojureScript to expand further on why you need to do it this way.
[0] https://leiningen.org/
I don't have any javascript in my project so do not use npm
. Maybe you have a plugin in project.clj
which adds the npm
task...