mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected notifications from "DAP" for every step

dhruvmanila opened this issue · comments

Debug adapter definition and debug configuration

This does not seem to be a problem of any adapter.

Debug adapter version

Not a problem for any adapter.

Steps to Reproduce

Using the below minimal.lua file, first open the editor at commit 688cb52 where the notifications started appearing and then at the parent commit 9c783d8 where the notifications are not coming.

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]

local package_root = '/tmp/nvim/site/pack'
local packer_install_path = package_root .. '/packer/start/packer.nvim'

local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',

      -- Add plugins to test...
      {
        'mfussenegger/nvim-dap',
        -- commit from which the notifications started appearing
        commit = '688cb52d8bfbb237531056b24d727f33ff4bedfa',

        -- this is the parent commit of the one mentioned above where the
        -- notifications are not coming
        -- commit = '9c783d8d2a6f776ee817281f0bf07d356524cc1f',
      },
      'mfussenegger/nvim-dap-python',
    },
    config = {
      package_root = package_root,
      compile_path = packer_install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end

_G.load_config = function()
  -- Add the necessary `init.lua` settings which could include the setup
  -- functions for the plugins...
  vim.g.mapleader = ' '

  local dap = require 'dap'
  local dap_python = require 'dap-python'

  vim.keymap.set('n', '<F5>', dap.continue)
  vim.keymap.set('n', '<F10>', dap.step_over)
  vim.keymap.set('n', '<F11>', dap.step_into)
  vim.keymap.set('n', '<F12>', dap.step_out)
  vim.keymap.set('n', '<leader>db', dap.toggle_breakpoint)
  vim.keymap.set('n', '<leader>ds', dap.terminate)

  -- set this path as per your system
  dap_python.setup(vim.loop.os_homedir() .. '/.neovim/.venv/bin/python')
  dap_python.test_runner = 'pytest'
end

if vim.fn.isdirectory(packer_install_path) == 0 then
  print 'Installing plugins and dependencies...'
  vim.fn.system {
    'git',
    'clone',
    '--depth=1',
    'https://github.com/wbthomason/packer.nvim',
    packer_install_path,
  }
end

load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
  1. Open any python file
  2. Set a breakpoint using db
  3. Notice there is Reason: breakpoint being printed at the bottom
  4. Each step will print the reason

Expected Result

There should be no message printed for each step taken.

Actual Result

With each step, the message of the format Reason: <reason> is being printed.

Noticed the same here. I don't think it's a bug, but it's a very annoying behavior. It would be great to remove stepping notifications, because half of my screen looks like this:

изображение

(it also notify about single breakpoint twice)

It would be really helpful to be able to notify, but reuse a previous notification window instead of making a new one..

Maybe passing some id information to vim.notify could be implemented by notification implementations, but I'm not sure who should decide the name of that option, and scope of that config & operation..

It would be really helpful to be able to notify, but reuse a previous notification window instead of making a new one..

It would be great to have it for all other kinds of notifications. But notifications about stepping seems useless to me. I already know that I stepped.

#591 removed the notify call