Skip to content

Commit

Permalink
fix(dap): load vscode launch files with jsonc parser (#1839)
Browse files Browse the repository at this point in the history
This seems to be the proper fix for #1503. jsonc ensures compatibility
with native vscode.

Ref: mfussenegger/nvim-dap#964
  • Loading branch information
moetayuko committed May 15, 2024
1 parent a97fa3b commit 543dead
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lua/lazyvim/plugins/extras/dap/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,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)
Expand Down Expand Up @@ -81,6 +79,11 @@ return {
},
},
},

-- VsCode launch.json parser
{
"folke/neoconf.nvim",
},
},

-- stylua: ignore
Expand Down Expand Up @@ -115,5 +118,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,
}

0 comments on commit 543dead

Please sign in to comment.