Skip to content
This repository was archived by the owner on Jan 3, 2024. It is now read-only.

Handle Invalid JSON in Cargo Output #429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lua/rust-tools/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ function M.start(args)
local executables = {}

for _, value in pairs(j:result()) do
local artifact = vim.fn.json_decode(value)
local ok, artifact = pcall(vim.fn.json_decode,value)
if not ok then
goto loop_end
end

-- only process artifact if it's valid json object and it is a compiler artifact
if
Expand Down