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

Cannot launch with another rpc client #30

Closed
axieax opened this issue Apr 6, 2023 · 4 comments
Closed

Cannot launch with another rpc client #30

axieax opened this issue Apr 6, 2023 · 4 comments

Comments

@axieax
Copy link

axieax commented Apr 6, 2023

Hi, I'm having trouble launching the server when I have another plugin flatten.nvim which connects to the nvim rpc server. Is there a solution to ensure both plugins work at the same time?

E5108: Error executing lua Vim:Error invoking 'nvim_exec_lua' on channel 3:
ch 3 was closed by the client
stack traceback:
        [C]: in function 'rpcrequest'
        ...re/nvim/lazy/one-small-step-for-vimkind/lua/osv/init.lua:134: in function 'launch'
        [string ":lua"]:1: in main chunk
@jbyuki
Copy link
Owner

jbyuki commented Apr 6, 2023

To give a small overview of what's happening, one-small-step-for-vimkind (osv) is spawing a embedded instance of neovim to exchange DAP messages, this is required as part of its good operation. The problem is that flatten.nvim seem to exit that instance immediatly. I haven't tested the code so it's just suppositions but I think if an embedded neovim is spawned within neovim without any argument file, flatten.vnim kills it basically. If I'm correct, any plugin using an embedded neovim instance will be unusable with flatten.nvim. Maybe ask them about this. Even if osv spawns an instance with a dummy file, it will be killed. I don't have a good solution right now, I suggest talking to flatten.nvim's creator for solutions.

EDIT: I have added a temporary workaround. It's very hacky so I still suggest talking to flatten's creator. It will basically unset $NVIM when spawning the embedded neovim which will not allow flatten.nvim to know it's embedded. Launch the osv server like this :lua require"osv".launch({port = 8086, flatten_nvim= true}). Let me know if it works, I haven't tested it.

jbyuki added a commit that referenced this issue Apr 6, 2023
@jbyuki jbyuki closed this as completed Apr 7, 2023
@axieax
Copy link
Author

axieax commented Apr 10, 2023

Thanks for the detailed explanation and temporary fix! I'll create an issue under flatten.nvim as well :))

@jbyuki
Copy link
Owner

jbyuki commented Apr 10, 2023

Great, I'll make that ugly hack disappear once there is a better solution for it.

@axieax
Copy link
Author

axieax commented Apr 12, 2023

Issue should be resolved now on flatten.nvim's side. Currently it requires enabling the nest_if_no_args config option, which isn't the default option yet.

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