Created
March 27, 2024 20:33
-
-
Save destinio/e2131a19c2fe3d64e5f7de6288d41086 to your computer and use it in GitHub Desktop.
js dap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- js | |
require('dap-vscode-js').setup { | |
-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node" | |
debugger_path = vim.fn.stdpath 'data' .. '/lazy/vscode-js-debug', -- Path to vscode-js-debug installation. | |
adapters = { 'chrome', 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost', 'node', 'chrome' }, -- which adapters to register in nvim-dap | |
} | |
for _, language in ipairs(js_based_languages) do | |
require('dap').configurations[language] = { | |
{ | |
type = 'pwa-node', | |
request = 'launch', | |
name = 'Launch file', | |
program = '${file}', | |
cwd = '${workspaceFolder}', | |
}, | |
{ | |
type = 'pwa-node', | |
request = 'attach', | |
name = 'Attach', | |
processId = require('dap.utils').pick_process, | |
cwd = '${workspaceFolder}', | |
}, | |
{ | |
type = 'pwa-chrome', | |
request = 'launch', | |
name = 'Start Chrome with "localhost"', | |
url = 'http://localhost:3000', | |
webRoot = '${workspaceFolder}', | |
userDataDir = '${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir', | |
}, | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment