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

UnhandledRejection: request error nvim_buf_set_lines #1

Open
luiz00martins opened this issue Jul 14, 2021 · 9 comments
Open

UnhandledRejection: request error nvim_buf_set_lines #1

luiz00martins opened this issue Jul 14, 2021 · 9 comments

Comments

@luiz00martins
Copy link

Full log

[coc.nvim]: UnhandledRejection: request error nvim_buf_set_lines - Wrong type for argument 1 when calling nvim_buf_set_lines, expecting Buffer
Error
    at rN.request (/home/luiz00martins/.local/share/nvim/plugged/coc.nvim/build/index.js:29:34621)
    at rN.setLines (/home/luiz00martins/.local/share/nvim/plugged/coc.nvim/build/index.js:29:36516)
    at /home/luiz00martins/.local/share/nvim/plugged/coc-isabelle/lib/index.js:5461:23
    at ke (/home/luiz00martins/.local/share/nvim/plugged/coc.nvim/build/index.js:35:1456)
    at Kh (/home/luiz00martins/.local/share/nvim/plugged/coc.nvim/build/index.js:34:11231)
    at Immediate._onImmediate (/home/luiz00martins/.local/share/nvim/plugged/coc.nvim/build/index.js:34:11111)
    at processImmediate (node:internal/timers:464:21)

Details

I was first unable to get the Isabelle server running, which makes sense, as the isabelle command was not working in my environment. As such, I changed the Isabelle command in the options to point to the exact executable. This is my coc-settings.json:

{
  "isabelle.command": "Isabelle/bin/isabelle"
}

When opening a file, the server seems to work, displaying the message [coc.nvim] Welcome to Isabelle/HOL (Isabelle repository snapshot c526eb2c7ca0 30-Mar-2021).

However, after some seconds of silence (in which I assume it is processing the imported theorems), I get the error message above, with no output in the -OUTPUT- buffer. From this point forward, the same error appears whenever the cursor moves to a place that would require Isabelle to further process the state (e.g. it doesn't appear when moving the cursor through comments, but it does when entering a theorem).

@ThreeFx
Copy link
Owner

ThreeFx commented Jul 14, 2021

Which nvim version are you using? The plugin might work on 0.5 only, but I'm not sure.

@luiz00martins
Copy link
Author

The nightly one: v0.6.0-dev

I'll probably try the stable build later to see if it works there

@ThreeFx
Copy link
Owner

ThreeFx commented Jul 15, 2021

Maybe they introduced an incompability by changing the highlighting API? That's what the error message looks like to me. I'm on some 0.5.0-prerelease candidate and it works fine for me. If it works for you with 0.5.0 I'll add a note the README and close this issue.

@luiz00martins
Copy link
Author

I just completed a fresh OS install (Pop OS), and installed neovim from apt (version 0.4.4), and from github (version 0.5.0). No luck. Not even the [coc.nvim] Welcome to Isabelle/HOL (Isabelle repository snapshot c526eb2c7ca0 30-Mar-2021) message appears.

In both versions, when opening a .thy file, the syntax highlight/conceal works, and the -PROGRESS- and -OUTPUT open, but nothing after this. (It's important to note that the error also does not appear, so it's likely that the Isabelle binary isn't being loaded in the first place).

Here's the steps I went through:

  1. Downloading the Isabelle tar.gz and extracting into a directory.
  2. Installing neovim.
  3. Installing coc and coc-isabelle with vim-plug (Plug 'ThreeFx/coc-isabelle', {'do': 'yarn install --frozen-lockfile'}).
  4. Putting the Isabelle binary path in my coc-settings.json ("isabelle.command": "Programs/Isabelle/bin/isabelle").
  5. Running a .thy file with (both versions of) neovim.

Unfortunately, it didn't work.

I ran Programs/Isabelle/bin/isabelle in my shell, and it worked as expected, so the path is correct. I also pointed the same directory to Makarius' Isabelle VsCode plugin, and it was able to compile the program and show the state, so the binary is working correctly.

@ThreeFx
Copy link
Owner

ThreeFx commented Jul 20, 2021

Ah there's another thing it could be: Do you have my isabelle.vim plugin installed as well?

I know that I refactored who creates the -OUTPUT- buffer at some point, and maybe I forgot to clarify that these two plugins are kinda dependent on each other.

@luiz00martins
Copy link
Author

Completely forgot to mention it. Yes, I do have isabelle.vim installed (with Plug 'ThreeFx/isabelle.vim', right before coc-isabelle's install).

Is there any configuration I need to do there as well?

@luiz00martins
Copy link
Author

Update: It seems like I wasn't getting any output because I didn't properly install yarn. After installing yarn, I was able to run coc-isabelle on 0.4.4 and 0.5.0. Unfortunately though, I received the same error in both versions. I even stripped my init.vim completely, leaving only the lines to install coc, isabelle.vim, and coc-isabelle plus the autocommands. This is my whole init.vim:

call plug#begin(stdpath('data') . '/plugged')
	Plug 'neoclide/coc.nvim'
	Plug 'ThreeFx/isabelle.vim'
	Plug 'ThreeFx/coc-isabelle', {'do': 'yarn install --frozen-lockfile'}
call plug#end()

au BufRead,BufNewFile *.thy setfiletype isabelle
au BufRead,BufNewFile *.thy set conceallevel=2

Still, the same error occurs.

It's worthy noting however, that when I was installing coc-isabelle, I was got two warning messages:

yarn install v1.22.10en-lockfile
[1/5] Validating package.json...
warinng coc-isabelle@0.0.0-development: The engine "coc" appears to be invalid.
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > coc.nvim@0.0.80" has unmet peer dependency "@types/node@10.12.0".

However, I have nodejs 12.21.0 and coc installed, so I'm not sure why these messages are appearing.

@gaganchandan
Copy link

I'm having the exact same problem. @luiz00martins did you find a fix?

@luiz00martins
Copy link
Author

@gaganchandan nope, I just switched to lean 😆

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

3 participants