mfussenegger / nvim-dap

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

Pick process shows no results #993

Closed MariaSolOs closed 11 months ago

MariaSolOs commented 12 months ago

Debug adapter definition and debug configuration

I have the following configuration for debugging JavaScript/TypeScript code:

return {
    {
        'mfussenegger/nvim-dap',
        dependencies = {
            -- JS/TS debugging.
            {
                'mxsdev/nvim-dap-vscode-js',
                opts = {
                    debugger_path = vim.fn.stdpath 'data' .. '/lazy/vscode-js-debug',
                    adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' },
                },
            },
            {
                'microsoft/vscode-js-debug',
                version = '1.x',
                build = 'npm i && npm run compile vsDebugServerBundle && mv dist out',
            },
        },
        config = function()
            local dap = require 'dap'

            for _, language in ipairs { 'typescript', 'javascript' } do
                dap.configurations[language] = {
                    {
                        type = 'pwa-node',
                        request = 'attach',
                        processId = require('dap.utils').pick_process,
                        name = 'Attach debugger to existing node process',
                        sourceMaps = true,
                        cwd = '${workspaceFolder}',
                        resolveSourceMapLocations = {
                            '${workspaceFolder}/**',
                            '!**/node_modules/**',
                        },
                        outFiles = {
                            '${workspaceFolder}/**',
                            '!**/node_modules/**',
                        },
                        skipFiles = { '**/node_modules/**' },
                    },
                }
            end
        end,
    },
}

After 0a02ed103e4da1928dc88428248dec7bb5ee6f34, nothing shows up in the pick process window. I cannot reproduce this with d17d1bba23ec72a157bd183c57840c39e323f515.

Debug adapter version

vscode-js-debug 1.81.0

Steps to Reproduce

  1. In a JavaScript file, set up a breakpoint.
  2. Start a node process to run that file, using node --inspect-brk.
  3. Run require('dap').continue() to open the pick_process window. Notice how there are no processes to pick from.

Expected Result

For the pick_process window to list something:

image

Actual Result

The window shown above lists nothing when updating nvim-dap to 0a02ed103e4da1928dc88428248dec7bb5ee6f34.