1

While I am working with nvim, I get occasion periods of 100% cpu stems mostly from the Python subprocess of nvim (some other times it is node). It happens when I do nothing in vim.

I tried to do profiling of vim functions, but nothing came up.

Apperently, the python plugins are: coc-python, leaderF, vim-netranger, ycm(disabled prob), vimspector. They are ordered by likelihood from the most likely to the least.

Is there a good way to debug this?

eyal karni
  • 1,106
  • 9
  • 33

1 Answers1

3

You could use that vimspector you have installed (in another instance of vim) to attach to the python process and get a stack trace.

Debugpy supports attach-by-PID so you do something like this:

python -m debugpy --listen localhost:5678 --pid <pid of the spinning process>

Then use vimspector to attach to it, using the simple remote-attach config.

You should then be able to see what it's doing; from the stack trace you could at least identify the errant plugin and report to the maintainer. I hope it's not one of mine ;)

Of course, you could also use pdb or something :)

puremourning
  • 145
  • 5