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

Vim:Error invoking 'nvim_exec_lua' on channel 7 #17

Closed
NEX-S opened this issue Aug 27, 2022 · 3 comments
Closed

Vim:Error invoking 'nvim_exec_lua' on channel 7 #17

NEX-S opened this issue Aug 27, 2022 · 3 comments

Comments

@NEX-S
Copy link

NEX-S commented Aug 27, 2022

if i using this to auto enable the osv

vim.api.nvim_create_autocmd({ "FileType" }, {
    pattern = "lua",
    callback = function ()
        require "osv".launch({
            host = '127.0.0.1',
            port = 8088,
            log = false
        })
    end
})

then i will get this error messages

Error detected while processing CursorMoved Autocommands for "*":
E5108: Error executing lua ...vim/site/pack/packer/opt/packer.nvim/lua/packer/load.lua:165: Vim(echomsg):E114: Missing quote: "Error in packer_compiled: ...vim/site/pack/packer/opt/packer.nvim/lu
a/packer/load.lua:155: Vim(append):Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:20: Vim(append):Error executing lua callback: Vim:Error invoking 'nvim_exec_lua' on channel 7
:
stack traceback:
        [C]: in function 'cmd'
        ...vim/site/pack/packer/opt/packer.nvim/lua/packer/load.lua:165: in function <...vim/site/pack/packer/opt/packer.nvim/lua/packer/load.lua:161>
        [string ":lua"]:1: in main chunk
@NEX-S
Copy link
Author

NEX-S commented Aug 27, 2022

I don't know why this would happen.
I am wondering if there are any ways I can using <C-d> to call dap.continue() in all languages that I have configured.

For example:
in C, I press <C-d>, dap starting to work.
in Python, I press <C-d>, dap starting to work.
in Lua, I press <C-d>, dap starting to work too (not asking me the host or port, set it default to 127.0.0.1 and 8088)

I wish "osv" can automatic start when I press <C-d> in lua.

i have tried to using autocmd to reach that for me.

vim.api.nvim_create_autocmd({ "FileType" }, {
    pattern = "lua",
    callback = function ()
        vim.keymap.set('n', '<C-d>', require "osv".run_this, { noremap = true, silent = true })
    end
})

but i will got this messages

Couldn't connect to 127.0.0.1:8088: ECONNREFUSED

here's my config

dap.configurations.lua = {
    {
        type = 'nlua',
        request = 'attach',
        name = "Attach to running Neovim instance",
        host = '127.0.0.1',
        port = 8088,
    }
}

dap.adapters.nlua = function (callback, config)
    callback({ type = 'server', host = config.host, port = config.port })
end

@jbyuki
Copy link
Owner

jbyuki commented Aug 27, 2022

Hi,

So one-small-step-for-vimkind is not really meant to be used as a debugger for vanilla lua scripts. It was specifically designed to debug neovim plugins. Meaning you still need to manually start another instance + start the server with launch(). You can still have a shortcut to dap.continue() in the debugger instance, which I also do. Maybe that clears some issues.

There is WIP ways to automatically start another neovim instance, and the debugger automatically here but this only works for linux/alacritty currently.

@NEX-S
Copy link
Author

NEX-S commented Aug 27, 2022

Thanks!

@NEX-S NEX-S closed this as completed Aug 27, 2022
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