Skip to content

Instantly share code, notes, and snippets.

@destinio
Created March 27, 2024 20:33
Show Gist options
  • Save destinio/e2131a19c2fe3d64e5f7de6288d41086 to your computer and use it in GitHub Desktop.
Save destinio/e2131a19c2fe3d64e5f7de6288d41086 to your computer and use it in GitHub Desktop.
js dap
-- 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