aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/lua
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2024-02-20 17:13:01 +0100
committerRuben Beltran del Rio <git@r.bdr.sh>2024-02-20 17:13:01 +0100
commita51791d1487a9673b3749135456f39d5e5b724ca (patch)
tree48f5ba6a71a5773414e25b2b4462fccad56e0b95 /config/nvim/lua
parent3f0543eabf72014ed44dfbf06e1580a3853bcee8 (diff)
Configure DAP for JS
Diffstat (limited to 'config/nvim/lua')
-rw-r--r--config/nvim/lua/dap_config.lua50
-rw-r--r--config/nvim/lua/plugins.lua1
2 files changed, 24 insertions, 27 deletions
diff --git a/config/nvim/lua/dap_config.lua b/config/nvim/lua/dap_config.lua
index 2131958..b84af74 100644
--- a/config/nvim/lua/dap_config.lua
+++ b/config/nvim/lua/dap_config.lua
@@ -5,29 +5,26 @@ vim.keymap.set('n', '<leader>d', function()
require("dapui").toggle()
end)
-dap.adapters.node2 = {
- type = 'executable',
- command = 'node',
- args = {os.getenv('HOME') .. '/projects/tools/vscode-node-debug2/out/src/nodeDebug.js'},
-}
+require("dap-vscode-js").setup({
+ debugger_path = os.getenv('HOME') .. '/projects/tools/vscode-js-debug/out/adapter.bundle.js',
+ adapters = { 'pwa-node', 'node-terminal' },
+})
+
dap.configurations.javascript = {
{
- name = 'Launch',
- type = 'node2',
- request = 'launch',
- program = '${file}',
- cwd = vim.fn.getcwd(),
- sourceMaps = true,
- protocol = 'inspector',
- console = 'integratedTerminal',
+ type = "pwa-node",
+ request = "launch",
+ name = "Launch file",
+ program = "${file}",
+ cwd = "${workspaceFolder}",
},
{
- -- For this to work you need to make sure the node process is started with the `--inspect` flag.
- name = 'Attach to process',
- type = 'node2',
- request = 'attach',
+ type = "pwa-node",
+ request = "attach",
+ name = "Attach",
processId = require'dap.utils'.pick_process,
- },
+ cwd = "${workspaceFolder}",
+ }
}
dap.adapters.firefox = {
@@ -37,14 +34,14 @@ dap.adapters.firefox = {
}
dap.configurations.typescript = {
- {
- name = 'Debug with Firefox',
- type = 'firefox',
- request = 'launch',
- reAttach = true,
- url = 'http://localhost:3000',
- webRoot = '${workspaceFolder}',
- firefoxExecutable = '/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox'
+ {
+ name = 'Debug with Firefox',
+ type = 'firefox',
+ request = 'launch',
+ reAttach = true,
+ url = 'http://localhost:3000',
+ webRoot = '${workspaceFolder}',
+ firefoxExecutable = '/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox'
}
}
@@ -115,4 +112,3 @@ dap.configurations.python = {
require('neodev').setup({
library = { plugins = { "nvim-dap-ui" }, types = true }
})
-
diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua
index 17f2fb4..24154d9 100644
--- a/config/nvim/lua/plugins.lua
+++ b/config/nvim/lua/plugins.lua
@@ -50,6 +50,7 @@ require('lazy').setup({
-- Debugging
'mfussenegger/nvim-dap',
'rcarriga/nvim-dap-ui',
+ 'mxsdev/nvim-dap-vscode-js',
-- Editing
'ms-jpq/coq_nvim',