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 = {
includeInlayEnumMemberValueHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
@ -107,11 +103,13 @@ return {
},
}
end
if not dap.adapters['node'] then
dap.adapters['node'] = function (cb, config)
config.type = debugtypePreferred[config.type] or config.type
local nativeAdapter = dap.adapters['pwa-node']
if type(nativeAdapter) == 'function' then
if not dap.adapters["node"] then
dap.adapters["node"] = function(cb, config)
if config.type == "node" then
config.type = "pwa-node"
end
local nativeAdapter = dap.adapters["pwa-node"]
if type(nativeAdapter) == "function" then
nativeAdapter(cb, config)
else
cb(nativeAdapter)