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

osv Freeze nvim after :lua require"osv".run_this() on NVIM v0.11.0-dev-19+g0f4f7d32c #49

Closed
MikeLemo1 opened this issue Jun 10, 2024 · 3 comments

Comments

@MikeLemo1
Copy link

I never had luck debugging nvim runtime lua plugins with one-small-step-for-vimkind but I upgraded my nvim since and wanted to give it a second chance but this time when I use require"osv".run_this() is completely freezes nvim and I'm not sure why I suspect it might have something to do with my nvim version but I'm here to confirm.

@jbyuki
Copy link
Owner

jbyuki commented Jun 10, 2024

Hi @MikeLemo1 ,

I'm running v0.11 myself and run_this does not freeze. Without more information, I can only suspect a bad interaction with another plugin/configuration. Please try it just with nvim-dap and osv installed without any configuration. Then by successively adding back other plugins, we can see which one causes the issue.

Note that run_this is not very practical, usually osv via launch() is used to debug plugins. See here for a video on how to debug a session.

@MikeLemo1
Copy link
Author

MikeLemo1 commented Jun 11, 2024

Hi @MikeLemo1 ,

I'm running v0.11 myself and run_this does not freeze. Without more information, I can only suspect a bad interaction with another plugin/configuration. Please try it just with nvim-dap and osv installed without any configuration. Then by successively adding back other plugins, we can see which one causes the issue.

Note that run_this is not very practical, usually osv via launch() is used to debug plugins. See here for a video on how to debug a session.

this is my dap.lua conf now

local M = {
  "mfussenegger/nvim-dap",
  dependencies = {
    {"jbyuki/one-small-step-for-vimkind"},
    {"rcarriga/nvim-dap-ui"},
    {"nvim-neotest/nvim-nio"},
    {"theHamsta/nvim-dap-virtual-text"},
  },
}

function M.config()
  local dap = require('dap')
  local dapui = require('dapui')
  local osv = require('osv')
  dap.configurations.lua = { 
    { 
      type = 'nlua', 
      request = 'attach',
      name = "Attach to running Neovim instance",
    }
  }

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

  vim.keymap.set('n', '<leader>Db', dap.toggle_breakpoint)
  vim.keymap.set('n', '<leader>Dc', dap.continue)
  vim.keymap.set('n', '<leader>Dd', dap.down)
  vim.keymap.set('n', '<leader>Dn', dap.step_over)
  vim.keymap.set('n', '<leader>Dr', dap.repl.open)
  vim.keymap.set('n', '<leader>Ds', dap.step_into)
  vim.keymap.set('n', '<leader>Du', dap.up)
  vim.keymap.set('n', '<leader>Dv', osv.launch)

end

return M

I've downgraded to V0.10.0 and same thing so it's not the nvim version according to what you say.
at this point I'm not sure if I'm doing something wrong, because simply configuring nvim doesn't do it,
In another case after commenting some plugins and configs the osv.launch() doesn't seem to freeze nvim but rather starting the server with no response (just printing "started at port 8068")...(also placing break points now doesn't mark the line)
Im trying now to install actboy168/lua-debug but struglling a bit with that (also is that necessary? any other pre-requisites? in what absolute directory should it be installed?)

does lspconfig need to be setup in a particular way for osv to work?

@jbyuki
Copy link
Owner

jbyuki commented Jun 11, 2024

Last keymap should be:

  vim.keymap.set('n', '<leader>Dv', function() osv.launch({port=8086}) end)

Please read the manual here. There is an instruction on how to start a debugging session with launch. It should work in normal cases.

@jbyuki jbyuki closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2024
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