mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim
GNU General Public License v3.0
5.09k stars 179 forks source link

version 0.8.0 with plugins telescope/telescope-ui/nvim-dap-go unable to run processId at correct time. #1258

Closed MimeLyc closed 3 weeks ago

MimeLyc commented 3 weeks ago

Debug adapter definition and debug configuration

I configured and installed the following plugins using Lazy, and all of these plugins are up to date:

...
    'nvim-telescope/telescope.nvim',
...
{
    'nvim-telescope/telescope-dap.nvim',
   },
  {
    'mfussenegger/nvim-dap',
  },
{
    'rcarriga/nvim-dap-ui',
    dependencies = { "mfussenegger/nvim-dap" },
    config = function()
      require('dapui').setup()
    end
  },
  {
    'leoluz/nvim-dap-go',
    requires = { 'mfussenegger/nvim-dap' },
    config = function()
      require('dap-go').setup() 
    end,
  },
...

Debug adapter version

master

Steps to Reproduce

  1. Install above plugins.
  2. Config them as recommended, and the configs of nvim-dap and nvim-dap-go can be left as default.
  3. Open a go project.
  4. Open the telescope to select go:Attach image
  5. Select target process, and you'll see the error image

I tried to dump some infos from the related plugins, and I found some weird things happened:

  1. After https://github.com/mfussenegger/nvim-dap/blob/6f79b822997f2e8a789c6034e147d42bc6706770/lua/dap.lua#L363 this function, the processId is setted as {}
  2. This function is called before my selection of process.

And I downgrade the version from 0.8.0 to 0.7.0 and everything goes well.

Expected Result

Work as 0.7.0

Actual Result

E5108: Error executing lua: ...azy/telescope-dap.nvim/lua/telescope/_extensions/dap.lua:260: attempt to call upvalue 'cb' (a nil value) stack traceback: ...azy/telescope-dap.nvim/lua/telescope/_extensions/dap.lua:260: in function 'run_replace_or_original' ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func' ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:293: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:292>

mfussenegger commented 3 weeks ago

That's a problem with the telescope-dap extension. It's overriding dap.ui.pick_one in https://github.com/nvim-telescope/telescope-dap.nvim/blob/master/lua/telescope/_extensions/dap.lua#L240

It shouldn't do that.