js debug
This commit is contained in:
parent
0df63e81e8
commit
8e9157ea87
1 changed files with 52 additions and 0 deletions
52
init.lua
52
init.lua
|
@ -152,8 +152,10 @@ require("lazy").setup({
|
||||||
{ "nvimtools/none-ls.nvim", event = "LspAttach" },
|
{ "nvimtools/none-ls.nvim", event = "LspAttach" },
|
||||||
{ "mfussenegger/nvim-dap", event = "LspAttach" },
|
{ "mfussenegger/nvim-dap", event = "LspAttach" },
|
||||||
{ "rcarriga/nvim-dap-ui", event = "LspAttach" },
|
{ "rcarriga/nvim-dap-ui", event = "LspAttach" },
|
||||||
|
{ "theHamsta/nvim-dap-virtual-text", config = true, event = "LspAttach" },
|
||||||
{ "suketa/nvim-dap-ruby", config = true, ft = "ruby" },
|
{ "suketa/nvim-dap-ruby", config = true, ft = "ruby" },
|
||||||
{ "leoluz/nvim-dap-go", config = true, ft = "go" },
|
{ "leoluz/nvim-dap-go", config = true, ft = "go" },
|
||||||
|
{ "mxsdev/nvim-dap-vscode-js", ft = "javascript" },
|
||||||
{ "nvimdev/lspsaga.nvim", event = "LspAttach" },
|
{ "nvimdev/lspsaga.nvim", event = "LspAttach" },
|
||||||
{ "is0n/jaq-nvim", event = "LspAttach" },
|
{ "is0n/jaq-nvim", event = "LspAttach" },
|
||||||
{ "j-hui/fidget.nvim", config = true, event = "LspAttach" },
|
{ "j-hui/fidget.nvim", config = true, event = "LspAttach" },
|
||||||
|
@ -501,6 +503,56 @@ require("dapui").setup({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--DAP-Javascript
|
||||||
|
local dap = require("dap")
|
||||||
|
|
||||||
|
dap.adapters["pwa-node"] = {
|
||||||
|
type = "server",
|
||||||
|
host = "localhost",
|
||||||
|
port = "${port}",
|
||||||
|
executable = {
|
||||||
|
command = "node",
|
||||||
|
args = {
|
||||||
|
vim.fn.stdpath("data") .. "/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js",
|
||||||
|
"${port}",
|
||||||
|
},
|
||||||
|
-- command = "js-debug-adapter",
|
||||||
|
-- args = { "${port}" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, language in ipairs({ "typescript", "javascript" }) do
|
||||||
|
dap.configurations[language] = {
|
||||||
|
{
|
||||||
|
type = "pwa-node",
|
||||||
|
request = "launch",
|
||||||
|
name = "Launch Current File (pwa-node)",
|
||||||
|
cwd = "${workspaceFolder}", -- vim.fn.getcwd(),
|
||||||
|
args = { "${file}" },
|
||||||
|
sourceMaps = true,
|
||||||
|
protocol = "inspector",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "pwa-node",
|
||||||
|
request = "launch",
|
||||||
|
name = "Launch Current File (Typescript)",
|
||||||
|
cwd = "${workspaceFolder}",
|
||||||
|
runtimeArgs = { "--loader=ts-node/esm" },
|
||||||
|
program = "${file}",
|
||||||
|
runtimeExecutable = "node",
|
||||||
|
-- args = { '${file}' },
|
||||||
|
sourceMaps = true,
|
||||||
|
protocol = "inspector",
|
||||||
|
outFiles = { "${workspaceFolder}/**/**/*", "!**/node_modules/**" },
|
||||||
|
skipFiles = { "<node_internals>/**", "node_modules/**" },
|
||||||
|
resolveSourceMapLocations = {
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"!**/node_modules/**",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
---jaq-nvim
|
---jaq-nvim
|
||||||
require("jaq-nvim").setup({
|
require("jaq-nvim").setup({
|
||||||
cmds = {
|
cmds = {
|
||||||
|
|
Loading…
Reference in a new issue