fix: properly parse JSONC in extensions.json and batch extension installs #707
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #708.
Summary
sed | jqJSONC parsing with a proper state-machine parser using the bundled Node.js binary--install-extensionflags) instead of one process per extensionProblem
.vscode/extensions.jsonis JSONC (JSON with Comments), not strict JSON. Thesed 's|//.*||g' | jqpipeline fails on block comments, trailing commas, and mangles URLs in strings.Fix
parse_jsonc_extensions.js) — uses thenodebinary already bundled with code-server/vscode-web, no new dependencies--install-extensionflags in one call instead of N separate processesNote on duplication
parse_jsonc_extensions.jsis duplicated in bothcode-server/andvscode-web/. The repo structure validator requires every subdirectory undermodules/to be a full module, so a sharedlib/directory isn't possible. This matches existing patterns (e.g. JFrog.tftplduplication). Happy to refactor if there's a preferred way to share code across modules.Test plan
parse_jsonc_extensions.test.ts): comments, trailing commas, URL safety,.code-workspaceformat--install-extensionworks with code-serverextensions.json(with//,/* */, trailing commas) parsed and extensions installed in single batched call using code-server's bundled node🤖 Generated with Claude Code