nvim-neotest / neotest

An extensible framework for interacting with tests within NeoVim.
MIT License
2.29k stars 114 forks source link

feat(client): show stacktrace information when adapter fails #397

Closed wookayin closed 5 months ago

wookayin commented 5 months ago

Problem: Warning messages via vim.notify do not retain stack trace, which makes errors or bugs happened on the adapters' side difficult to troubleshoot. E.g.:

    neotest-python: vim/_editor.lua:0: E5560: Vimscript function must not be called in a lua loop callback

Solution: Use xpcall, instead of pcall to access the stacktrace information, and use it when showing warning (error) messages. E.g.:

rcarriga commented 5 months ago

Thanks for the PR!