From 3d6ff35100fe3df842b6a5bb0b3ff3eeb395fe9f Mon Sep 17 00:00:00 2001 From: MoetaYuko Date: Sun, 22 Oct 2023 17:32:00 +0800 Subject: [PATCH] fix(dap): load vscode launch files with jsonc parser This seems to be the proper fix for #1503. jsonc ensures compatibility with native vscode. Ref: https://github.com/mfussenegger/nvim-dap/issues/964 --- lua/lazyvim/plugins/extras/dap/core.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index c9aa291a..41b688ec 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -25,8 +25,6 @@ return { }, opts = {}, config = function(_, opts) - -- setup dap config by VsCode launch.json file - -- require("dap.ext.vscode").load_launchjs() local dap = require("dap") local dapui = require("dapui") dapui.setup(opts) @@ -80,6 +78,11 @@ return { }, }, }, + + -- VsCode launch.json parser + { + "folke/neoconf.nvim", + }, }, -- stylua: ignore @@ -114,5 +117,10 @@ return { { text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] } ) end + + -- setup dap config by VsCode launch.json file + local vscode = require("dap.ext.vscode") + vscode.json_decode = require("neoconf.json.jsonc").decode_jsonc + vscode.load_launchjs() end, }