From 85cb1962967871eef81638bba703e4dd8f1a8e89 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 15 May 2024 16:08:04 +0200 Subject: [PATCH] refactor: ... --- lua/lazyvim/plugins/extras/lang/typescript.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index fbca155f..a1c6aba1 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -1,7 +1,3 @@ -local debugtypePreferred = { - ['node'] = 'pwa-node', -} - local inlay_hints_settings = { includeInlayEnumMemberValueHints = true, includeInlayFunctionLikeReturnTypeHints = true, @@ -107,12 +103,14 @@ 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 - nativeAdapter(cb, config ) + 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) end