Created
November 29, 2023 13:24
-
-
Save myypo/c51fef8f3ae32ed4f44eec9d691123ad to your computer and use it in GitHub Desktop.
This file contains 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
return { | |
"mxsdev/nvim-dap-vscode-js", | |
ft = { "typescript", "javascript" }, | |
dependencies = { | |
{ | |
"microsoft/vscode-js-debug", | |
version = "1.x", | |
build = "npm i && npm run compile vsDebugServerBundle && mv dist out", | |
}, | |
}, | |
config = function() | |
require("dap-vscode-js").setup({ | |
debugger_path = vim.fn.stdpath("data") .. "/lazy/vscode-js-debug", | |
}) | |
end, | |
} |
This file contains 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
return { | |
"mfussenegger/nvim-dap", | |
keys = { | |
{ "<F1>", "<cmd>lua require('dapui').toggle()<CR>", desc = "dapui_toggle" }, | |
}, | |
config = function() | |
local dap = require("dap") | |
dap.configurations.cpp = { | |
{ | |
name = "Launch", | |
type = "lldb", | |
request = "launch", | |
program = function() | |
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") | |
end, | |
cwd = "${workspaceFolder}", | |
stopOnEntry = false, | |
args = {}, | |
}, | |
} | |
dap.configurations.c = dap.configurations.cpp | |
local js_based_languages = { "typescript", "javascript", "typescriptreact" } | |
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", | |
port = function() | |
return vim.fn.input("Select port: ", 9229) | |
end, | |
name = "Attach", | |
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 | |
end, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment