Awesome
nluarepl
A nvim-lua debug adapter for use with nvim-dap.
Supported features:
- Evaluate expressions (Watch demo)
- Logpoints with optional conditions (Watch demo)
Other features like stopping at breakpoints, is not supported due to the architecture of this plugin. Both Client and debug adapter cannot run in the same thread if a breakpoint needs to pause execution.
The main goal for this is to have an interactive REPL to query and modify the running nvim instance.
If you're looking for a way to debug Neovim plugins with full breakpoint support you should head to osv.
Installation
- Install nvim-dap; it's a dependency
- Install this plugin:
git clone https://github.com/mfussenegger/nluarepl.git \
~/.config/nvim/pack/plugins/start/nluarepl
Usage
The plugin automatically registers a nluarepl
adapter for nvim-dap
and
creates a nluarepl
configuration which is always available. You can start it
using :DapNew nluarepl
or via dap.continue()
. Afterwards open the
nvim-dap
REPL using :DapToggleRepl
and start typing expressions.
For longer multi-line statements you can open a dap-eval buffer using :sp dap-eval://lua
and then execute expressions via :w
inside that buffer.
Limitations
- Logpoints won't work for functions baked into nvim. This includes functions
like
vim.split
or other functions defined in shared.lua nluarepl also can't provide source locations for these functions.
Disclaimer: There's a chance the functionality of this plugin could get included in osv, if that happens this plugin here will be archived.