Skip to content

v0.1.12

Choose a tag to compare

@wuruihi wuruihi released this 25 Aug 13:05
· 9 commits to main since this release

Fix: dsh-ui component render failure (JSON parse error)

Root cause

scanJsonValue tracked both {/[ and }/] in a single depth counter, while VSCode scanValue only tracks the matching bracket pair. For malformed JSON (rows array missing closing ], table closed early by }), the mixed counter found the balanced end at a stray ] at EOF, slicing the entire string including orphan callout + trailing ]}. balanceClose then hit empty-stack ] and returned null, causing repairSpec to fail entirely.

Fix

scanJsonValue now tracks only the matching bracket pair ({->} or [->]), ignoring the other type. This correctly stops at the root object }, letting balanceClose repair the malformed rows array, and repairSpec merges the orphan callout back into items.

Additional hardening

  • lenientJsonParse: handle unescaped quotes in string values
  • wrapBareMembers: ported from VSCode, fixes bare key/value pairs inside arrays
  • splitDshUiSegments: rewritten to line-by-line fence scanning
  • wrapDshUiJson: use lenientJsonParse for candidate validation
  • opener regex allows whitespace between backticks and dsh-ui
  • closing fence detection is more lenient