Skip to content

Command and configuration frontend for Debugpy and nvim-dap

License

Notifications You must be signed in to change notification settings

HiPhish/debugpy.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debugpy.nvim

Thin and hackable frontend command to nvim-dap and Debugpy for debugging Python code in Neovim. This plugin provides a new command :Debugpy which can take a number of sub-commands to generate an appropriate debugger configuration on the fly.

Installation

  • Set up nvim-dap to your liking
  • Install the Debugpy adapter into your Python environment
  • Install Debugpy.nvim like any other Neovim plugin

You can run the health check (:checkhealth debugpy) to verify that all dependencies are available.

I recommend running nvim-dap manually first to make sure it works before invoking the :Debugpy command from this plugin. It provides only a way of starting the debugger, it does not interfere with other aspects of the debugger.

A reasonable default adapter configuration named debugpy is provided, but you can override it with your own or extend it.

Usage

The new :Debugpy command starts the debugger with an appropriate configuration generated from its parameters. The first argument is mandatory and determines what to debug. Example:

" Debug a certain Python module by running it directly
Debugpy module app.main

" Debug an entire program
Debugpy program app foo bar

" Attach to a running debugger process on the localhost listening to port
" 5678 (you have to spell out the IP, typing 'localhost' does not work)
Debugpy attach 127.0.0.1 5678

Here module, program and attach are the sub-command which tell the debugger to debug a given module, and app.main is the name of the module. The arity of a sub-command depends on the particular sub-command; e.g. module takes exactly one argument while program takes any number of arguments.

For more information please refer to the documentation.

License

Licensed under the terms of the MIT (Expat) license. Please refer to the LICENSE file for more information.