pocco81 / dap-buddy.nvim

🐞 Debug Adapter Protocol manager for Neovim
GNU General Public License v3.0
400 stars 48 forks source link

How do you actually run the debugger 😅 #60

Open joshpetit opened 2 years ago

joshpetit commented 2 years ago

Hey, thanks for making such an easy to use plugin. I've been able to get everything installed, but don't see any specific documentation on how to run the debugger. Could you let me know how to do that?

pocco81 commented 2 years ago

Check nvim DAP's documentation: https://github.com/mfussenegger/nvim-dap/blob/master/doc/dap.txt

hope it helps :)

joshpetit commented 2 years ago

Yea I've used nvim-dap's debugger and have run it just fine, I'm just confused on how to use it with dap install, this is how I run my node debugger:

M.node = function()
    print("attaching")
    require('dap').run({
        type = 'node2',
        request = 'attach',
        cwd = vim.fn.getcwd(),
        sourceMaps = true,
        protocol = 'inspector',
        skipFiles = {'<node_internals>/**/*.js'}
    })
    require("dapui").open();
end

Looking at the documentation there seems to be multiple ways to run? How do I run using the built-in nvim-dap configuraiton? If you could point me to the specific place in the documentation that works with dap install I would appreciate it, it would make it easier for people to transition to using dap install as well.

joshpetit commented 2 years ago

I may be misunderstanding how the configuration works, when I use the default configuration it doesnt work since my flutter sdk and dart sdk paths are different, so I try to configure it like so:

dap_install.config("dart", {
    configurations = {
        {
            dartSdkPath = "/opt/flutter/bin/cache/dart-sdk/",
            flutterSdkPath = "/opt/flutter",
        },
    },
})

I tried with the name "dart" and "dart-code" . I get the error:

Invalid adapter `nil` for config `nil`

For 'dart' and the error:

No configuration found for `dart`. You need to add configs to `dap.configurations.dart` (See `:h dap-configuration`)

for 'dart-code' which makes me think it's not running with the overriden dart defaults. Is there a certain way I'm supposed to run it to work with dap-install? I'm just doing dap.continue() to start the process.