nvim-parinfer.js icon indicating copy to clipboard operation
nvim-parinfer.js copied to clipboard

Unknown function: ParinferIndent (only for .xtm file extension)

Open bryanmaina opened this issue 9 years ago • 8 comments

If I open a file with the following extension .xtm (which uses Lisp style expressions) and try to edit, I get this error in neovim:

Error detected while processing function <SNR>100_indent:                        
line    6:                                                                          
E117: Unknown function: ParinferIndent

This also happens only if I have 'timburgess/extempore.vim' installed. If I remove it there is no more problem. But I need extempore plugin to work with extempore.

I just added to my vimrc:

au BufNewFile,BufRead *.xtm let g:parinfer_mode = "off"

to avoid this error while waiting to know what's going wrong.

bryanmaina avatar Nov 28 '16 12:11 bryanmaina

I'm also running into this error but in .cljs files as well.

BerkeleyTrue avatar Feb 14 '17 03:02 BerkeleyTrue

For clojure @BerkeleyTrue, this is usually caused by not running :UpdateRemotePlugins it should give you feedback that it's registering nvim-parinfer.

@bryanmaina if I add the extempore.vim plugin and add a au BufNewFile,BufRead *.xtm set filetype=lisp line to my rc file, parinfer starts and runs without a problem. It sounds like it could be the same :UpdateRemotePlugins but unfortunately that's about as far as I can troubleshoot this without a repro.

snoe avatar Feb 15 '17 03:02 snoe

@snoe Unfortunately that does not seems to change things. This is the output from UpdateRemotePlugins

function remote#host#UpdateRemotePlugins[6]..<SNR>47_RegistrationCommands[13]..remote#host#RegisterPlugin, line 5
Plugin "/Users/berkeley/.config/nvim/plugged/clj-refactor.nvim/rplugin/node/clj-refactor.js" is already registered
remote/host: python3 host registered plugins ['deoplete']
remote/host: generated rplugin manifest: /Users/berkeley/.local/share/nvim/rplugin.vim

Here is the list of my plugins, maybe there is something conflicting?

https://github.com/BerkeleyTrue/dotfiles/blob/master/dotfiles/modules/plugins.vim

BerkeleyTrue avatar Feb 15 '17 04:02 BerkeleyTrue

This is what I've found messing around so far:

I also see this message Plugin "/Users/berkeley/.config/nvim/plugged/nvim-parinfer.js/rplugin/node/nvim-parinfer.js" is already registered

Looking into the manifest file after running UpdateRemotePlugin seems to have no calls to the nodehost

" python3 plugins
call remote#host#RegisterPlugin('python3', '/Users/berkeley/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete', [
      \ {'sync': v:true, 'name': '_deoplete', 'opts': {}, 'type': 'function'},
     \ ])


" ruby plugins


" python plugins

If I remove both nvim-parinfer and clj-refactor I get the following

" node plugins


" python3 plugins
call remote#host#RegisterPlugin('python3', '/Users/berkeley/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete', [
      \ {'sync': v:true, 'name': '_deoplete', 'opts': {}, 'type': 'function'},
     \ ])


" ruby plugins


" python plugins


Could it be the process that writes to this file is faulty?

BerkeleyTrue avatar Feb 15 '17 04:02 BerkeleyTrue

@BerkeleyTrue Can you make sure that you have the latest node-host and that the versions being brought in are similar to mine? I'm also on neovim 0.1.7 but the api has been quite stable unlike node-host's

also I think npm install --production would be an improvement on your BuildNodeHost

 $ npm list
[email protected] /Users/case/.vim/bundle/node-host
├── [email protected]
├── [email protected]
└─┬ [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ └─┬ [email protected]
  │   ├── [email protected]
  │   ├── [email protected]
  │   └─┬ [email protected]
  │     ├── [email protected]
  │     ├── [email protected]
  │     ├── [email protected]
  │     ├── [email protected]
  │     ├── [email protected]
  │     └── [email protected]
  └── [email protected]

~/.nvim/bundle/node-host on master
$ npm version
{ 'neovim-host': '0.0.1',
  npm: '3.10.7',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '57.1',
  modules: '48',
  node: '6.7.0',
  openssl: '1.0.2j',
  uv: '1.9.1',
  v8: '5.1.281.83',
  zlib: '1.2.8' }

snoe avatar Feb 15 '17 05:02 snoe

Some interesting developments:

First my versions are similar to yours. My neovim was a single version behind your so I updated it. [email protected] /Users/berkeley/.config/nvim/plugged/node-host ├── [email protected] ├── [email protected] └── [email protected]

BerkeleyTrue:node-host berkeley$ npm version { 'neovim-host': '0.0.1', npm: '3.10.10', ares: '1.10.1-DEV', http_parser: '2.7.0', icu: '57.1', modules: '48', node: '6.9.1', openssl: '1.0.2j', uv: '1.9.1', v8: '5.1.281.84', zlib: '1.2.8' }

Still the same issue.

Then I tried cleaning and re-installing the three packages in different combinations. That raised the same issue. Then I threw in re-starting vim between installing packages.

I removed all three packages, installed node-host, updated remote plugins, Installed nvim-parinfer, restarted neovim, and updated remote plugins. This showed the correct message and indeed parinfer was listed in rplugins.vim.

But then installing clj-refactor causes the following

function remote#host#UpdateRemotePlugins[6]..<SNR>47_RegistrationCommands, line 20
Vim(let):Channel was closed by the client

then removing clj-refactor gives me the same error as before.

I can can't nvim-parinfer working but I cannot get it working with clj-refactor.

Is it possible that node-host is caching somewhere within it's directories?

edit: Looks like if I completely remove node-hosts but leave nvim-parinfer in I still get the already registered but. Maybe this is an error with neovim itslelf?

BerkeleyTrue avatar Feb 15 '17 23:02 BerkeleyTrue

There's definitely an order dependency between installing plugins and calling :UpdateRemotePlugins and restarting neovim.

I'm able to repro your parinfer + refactor error, but I'm also able to recover by removing the refactor plugin line from my rc file, restarting nvim, running :UpdateRemotePlugins, restarting again, and then loading a clj file. I can do the opposite too - run refactor by itself and then adding parinfer blows up.

Unfortunately as with most issues here, I suspect that the source of the problem is somewhere in the node-host dependency chain. I had hoped that https://github.com/neovim/node-host/issues/21 would fix the multiple plugin issue, but it seems there's either been a regression or that fixed already registered plugins and installing multiple is still a problem.

I noticed your npm list maybe got cut off - [email protected] is the transitive dependency that should have fixed the above issue. Make sure you do have that installed at least.

I think, though, that the path forward is to add host capabilities to https://github.com/clojure-vim/neovim-client and drop node-host all together.

snoe avatar Feb 16 '17 16:02 snoe

I was never able to get parinfer and refactor to work nicely together so I abandoned it.

I'm not seeing this same issue with just nvim-parinfer on my new machine. I'll diagnose and post findings here.

edit:

Looks like it is registering correctly

" node plugins
call remote#host#RegisterPlugin('node', '/home/berkeleytrue/.config/nvim/plugged/nvim-parinfer.js/rplugin/node/nvim-parinfer.js', [
     \ ])


" python3 plugins


" ruby plugins


" python plugins



edit2: running lein npm install in plugin directory solved the issue.

I've changed my plug install to Plug 'clojure-vim/nvim-parinfer.js', { 'do': 'lein npm install' }

BerkeleyTrue avatar Mar 16 '18 19:03 BerkeleyTrue