mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim
GNU General Public License v3.0
5.11k stars 179 forks source link

Auto reload launch.json? #1123

Closed wakuflair closed 6 months ago

wakuflair commented 6 months ago

Problem Statement

Hi I am a newbie to nvim-dap (neovim too), so forgive me if this is a stupid request.

I am using nvim-dap in wrting a Rust program, and happily know it supports .vscode/launch.json. However I have to restart neovim to make it reload after chaning the launch.json. Am I missing something? Can the launch file be reloaded automatically?

Possible Solutions

No response

Considered Alternatives

No response

mfussenegger commented 6 months ago

nvim-dap by default registers a BufWritePost autocommand that re-reads the launch.json file, so it should already auto-reload changes.

If you use a type_to_filetypes mapping you'll have to define that globally to be picked up. For example

require('dap.ext.vscode').type_to_filetypes = {
  lldb = {'rust', 'c', 'cpp'},
}