mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 20:41:08 +00:00
fix(typescript): better default pwa-node DAP config. Closes #6386
This commit is contained in:
parent
1a08e9f50f
commit
e4d34328f2
1 changed files with 24 additions and 0 deletions
|
|
@ -263,6 +263,10 @@ return {
|
||||||
|
|
||||||
for _, language in ipairs(js_filetypes) do
|
for _, language in ipairs(js_filetypes) do
|
||||||
if not dap.configurations[language] then
|
if not dap.configurations[language] then
|
||||||
|
local runtimeExecutable = nil
|
||||||
|
if language:find("typescript") then
|
||||||
|
runtimeExecutable = vim.fn.executable("tsx") == 1 and "tsx" or "ts-node"
|
||||||
|
end
|
||||||
dap.configurations[language] = {
|
dap.configurations[language] = {
|
||||||
{
|
{
|
||||||
type = "pwa-node",
|
type = "pwa-node",
|
||||||
|
|
@ -270,6 +274,16 @@ return {
|
||||||
name = "Launch file",
|
name = "Launch file",
|
||||||
program = "${file}",
|
program = "${file}",
|
||||||
cwd = "${workspaceFolder}",
|
cwd = "${workspaceFolder}",
|
||||||
|
sourceMaps = true,
|
||||||
|
runtimeExecutable = runtimeExecutable,
|
||||||
|
skipFiles = {
|
||||||
|
"<node_internals>/**",
|
||||||
|
"node_modules/**",
|
||||||
|
},
|
||||||
|
resolveSourceMapLocations = {
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"!**/node_modules/**",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type = "pwa-node",
|
type = "pwa-node",
|
||||||
|
|
@ -277,6 +291,16 @@ return {
|
||||||
name = "Attach",
|
name = "Attach",
|
||||||
processId = require("dap.utils").pick_process,
|
processId = require("dap.utils").pick_process,
|
||||||
cwd = "${workspaceFolder}",
|
cwd = "${workspaceFolder}",
|
||||||
|
sourceMaps = true,
|
||||||
|
runtimeExecutable = runtimeExecutable,
|
||||||
|
skipFiles = {
|
||||||
|
"<node_internals>/**",
|
||||||
|
"node_modules/**",
|
||||||
|
},
|
||||||
|
resolveSourceMapLocations = {
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"!**/node_modules/**",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue