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

Jump-to-error not working in nvim #30

Closed
Tracked by #32
casey opened this issue Aug 17, 2022 · 2 comments
Closed
Tracked by #32

Jump-to-error not working in nvim #30

casey opened this issue Aug 17, 2022 · 2 comments

Comments

@casey
Copy link

casey commented Aug 17, 2022

Jump-to-error in nvim has been working sporadically for me. It's entirely possible that this is due to a config error on my part.

I have cargo-limit binaries and nvim-send in my path:

$ which nvim-send
/Users/rodarmor/.cargo/bin/nvim-send
$ which cargo-lcheck
/Users/rodarmor/.cargo/bin/cargo-lcheck

In my .vimrc I have:

Plug 'alopatindev/cargo-limit'

However, running something like cargo lcheck doesn't seem to invoke my g:CargoLimitOpen. I'm a bit of a loss as to how to debug this. Do you have any advice? The main question I'm trying to answer is: How does cargo-limit invoke nvim-send? Can I get it to print out logs? How does it find my nvim server?

I do seem to have an nvim server, :echo v:servername prints out:

/var/folders/b5/q2c4mxk534v6kwdtx2mpw91m0000gn/T/nvimoRduyt/0

Which when I pass to nvim-send:

$ nvim-send --servername /var/folders/b5/q2c4mxk534v6kwdtx2mpw91m0000gn/T/nvimoRduyt/0 --remote-send i

Does seem to work.

@alopatindev
Copy link
Member

How does cargo-limit invoke nvim-send?

With default config (without custom g:CargoLimitOpen) it's invoked in the following conditions:

  • before running nvim, current directory was project (sub)directory
  • current nvim mode is normal
  • current buffer is either empty or contains some existing and unmodified (saved) file

How does it find my nvim server?

nvim may create several socket files but only /tmp/nvim-cargo-limit-${USER}/%path%to%project%directory is used by cargo lcheck and cargo-limit.vim.

Do you have this socket file while nvim is running?

Do you have this socket file when nvim is not running? If yes — try to remove this file and rerun nvim.

For now the only known buggy case when nvim-send is not invoked is if nvim crashed/killed. This results to not removing the socket file and next time nvim plugin thinks that server is already running, so it doesn't recreate the socket file.

If you run multiple instances of nvim in your project (sub)directory — only the first instance should jump to error lines, that's normal behavior.

Can I get it to print out logs?

For now there is no logging. I might will add it in future if it really makes sense.

If the issue still reproduces for you:

  • which OS and nvim version you're using?
  • which full project path do you have? (any special characters?)

Thanks.

@casey
Copy link
Author

casey commented Aug 22, 2022

Thank you for the detailed response!

Frustratingly enough, everything started working again, and I'm not sure what I did. I don't actually think I did anything, so I still don't know what went wrong 😭 If it happens again, I'll refer to your message to debug. What you wrote is so comprehensive, I'd consider adding it to the docs on the editor integration.

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

2 participants