refactor: ...

This commit is contained in:
Folke Lemaitre 2024-05-15 16:08:04 +02:00
parent b697442a3e
commit 85cb196296
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -1,7 +1,3 @@
local debugtypePreferred = {
['node'] = 'pwa-node',
}
local inlay_hints_settings = { local inlay_hints_settings = {
includeInlayEnumMemberValueHints = true, includeInlayEnumMemberValueHints = true,
includeInlayFunctionLikeReturnTypeHints = true, includeInlayFunctionLikeReturnTypeHints = true,
@ -107,12 +103,14 @@ return {
}, },
} }
end end
if not dap.adapters['node'] then if not dap.adapters["node"] then
dap.adapters['node'] = function (cb, config) dap.adapters["node"] = function(cb, config)
config.type = debugtypePreferred[config.type] or config.type if config.type == "node" then
local nativeAdapter = dap.adapters['pwa-node'] config.type = "pwa-node"
if type(nativeAdapter) == 'function' then end
nativeAdapter(cb, config ) local nativeAdapter = dap.adapters["pwa-node"]
if type(nativeAdapter) == "function" then
nativeAdapter(cb, config)
else else
cb(nativeAdapter) cb(nativeAdapter)
end end