Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with latest version of node-host #32

Open
Kelvin-Chen opened this issue Aug 3, 2017 · 35 comments
Open

Does not work with latest version of node-host #32

Kelvin-Chen opened this issue Aug 3, 2017 · 35 comments

Comments

@Kelvin-Chen
Copy link

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.

neovim/node-host@0c116cb 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?

@snoe
Copy link
Member

snoe commented Aug 3, 2017

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?

@Kelvin-Chen
Copy link
Author

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.

@diffractometer
Copy link

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?

@Kelvin-Chen
Copy link
Author

@diffractometer I did not run into any issues with downgrading. Did you run npm install in the node-host directory?

@diffractometer
Copy link

@Kelvin-Chen Thanks! That worked! Derp, I should have tried that. 🍻 <~ on me. Cheers.

@diffractometer
Copy link

@snoe I'm not using any plugins which require node-host 1.0.0.

@ashnur
Copy link

ashnur commented Aug 19, 2017

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) 

@lambdahands
Copy link

lambdahands commented Aug 28, 2017

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.

@oemmerson
Copy link

All you need to do is cd to plugged/node-host, git checkout v0.0.1, npm install, restart vim and run :UpdateRemotePlugins.

@AlexChalk
Copy link

@snoe This is the only plugin I'm using with node-host.

@ashnur
Copy link

ashnur commented Nov 7, 2017

Is anyone using plugins that require node-host 1.0.0?

not even node-host

@markx
Copy link
Contributor

markx commented Nov 13, 2017

@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.

@snoe
Copy link
Member

snoe commented Nov 15, 2017

@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.

@snoe
Copy link
Member

snoe commented Nov 15, 2017

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.

@duikboot
Copy link

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

@duikboot
Copy link

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) 

@snoe
Copy link
Member

snoe commented Nov 15, 2017

@duikboot try to npm install -g yarn the neovim node host comments suggest that was an oversight left in checkhealth

@markx
Copy link
Contributor

markx commented Nov 16, 2017

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)

@billyvg
Copy link

billyvg commented Nov 16, 2017

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: neovim/node-client#42

@duikboot
Copy link

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

@snoe
Copy link
Member

snoe commented Nov 20, 2017

@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 ?

@snoe
Copy link
Member

snoe commented Nov 20, 2017

@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

@cbcoutinho
Copy link

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?

@duikboot
Copy link

duikboot commented Nov 26, 2017

@snoe It works now, I also had to add the node-modules bin directory to my $PATH

Thanks a lot

@janlazo
Copy link

janlazo commented Dec 24, 2017

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.

@duikboot
Copy link

Ik works for me

@diffractometer
Copy link

@cbcoutinho I also fixed by lein npm install, thanks.

@krisleech
Copy link

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.?

@cbcoutinho
Copy link

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/

@krisleech
Copy link

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...

@drayah
Copy link

drayah commented Jan 16, 2018

Running lein npm install in the ~/.config/nvim/plugged/nvim-parinfer.js directory fixes the issue for me. (I am using vim-plug)

@ashnur
Copy link

ashnur commented Feb 24, 2018

i am still getting:

"src/cljs/timing/app.cljs" 77L, 2047C                                                                                                                                                                                
Error detected while processing function <SNR>18_process:                                                                                                                                                            
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)                                                                                                                                                                            
Press ENTER or type command to continue    

updated npm/node before i tried, i see nvim-parinfer.js after UpdateRemotePlugins, but it's still unusable. (arch linux, updated)

@nbardy
Copy link

nbardy commented Mar 15, 2018

I'm having the same problem.

Running lein npm install in the plugin directory doesn't fix it as well.

@snoe
Copy link
Member

snoe commented Mar 16, 2018

I'm going to suggest people take a look at https://github.com/eraserhd/parinfer-rust it's early days but it's working right now without the need for remote plugins.

@ashnur
Copy link

ashnur commented Mar 20, 2018

parinfer rust works as expected out of the box. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests