mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-03-10 09:27:25 +00:00
fix(typescript): better default pwa-node DAP config. Closes #6386
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user