Skip to content

Commit

Permalink
dap and js debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
rpora committed Nov 23, 2023
1 parent 71afc6f commit 090e323
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" },
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" },
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"vscode-js-debug": { "branch": "main", "commit": "3df69ff4faf389301e1d9f05ba21c838462cc0d2" },
"vscode-js-debug": { "branch": "main", "commit": "14755d4dfdddc28b582217d3750c5553494e49f3" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
"zen-mode.nvim": { "branch": "main", "commit": "50e2e2a36cc97847d9ab3b1a3555ba2ef6839b50" }
}
30 changes: 6 additions & 24 deletions lua/kickstart/plugins/debug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ return {

{
"microsoft/vscode-js-debug",
version = "1.77",
build = "npm i && npm run compile vsDebugServerBundle && mv dist out"
}
},
Expand Down Expand Up @@ -84,8 +83,11 @@ return {
require('dap-go').setup()

require("dap-vscode-js").setup({
debugger_path = vim.fn.stdpath("data") .. "/lazy/vscode-js-debug",
adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' },
debugger_path = vim.fn.stdpath("data") .. "/lazy/vscode-js-debug",
adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' },
log_file_path = "/home/rpora/dap_vscode_js.log", -- Path for file logging
log_file_level = 0, -- Logging level for output to file. Set to false to disable file logging.
log_console_level = vim.log.levels.ERROR, -- Logging level for output to console. Set to false to disable console output.
})
-- Js based languages
local js_lang = { "typescript", "javascript", "typescriptreact"}
Expand All @@ -96,35 +98,15 @@ return {
request = 'launch',
name = 'Launch Current File (pwa-node)',
cwd = vim.fn.getcwd(),
args = { '${file}' },
sourceMaps = true,
protocol = 'inspector',
program = '${file}',
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require 'dap.utils'.pick_process,
cwd = "${workspaceFolder}",
sourceMaps = true,
resolveSourceMapLocations = { "${workspaceFolder}/**", "!**/node_modules/**"},
},
{
type = "pwa-chrome",
request = "launch",
name = "Start Chrome with \"localhost\"",
url = "https://localhost:3000",
webRoot = "${workspaceFolder}",
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir"
},
{
name= "Launch via npm",
type= "pwa-node",
request= "launch",
cwd= "${workspaceFolder}",
runtimeExecutable= "npm",
runtimeArgs = {"run-script", "dev"}
}
}
end

Expand Down

0 comments on commit 090e323

Please sign in to comment.