Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

fix: handle extensions.json comments in vscode-web and code-server #398

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

matifali
Copy link
Member

@matifali matifali commented Feb 6, 2025

Resolves #385

@matifali matifali self-assigned this Feb 6, 2025
Comment on lines +107 to +108
# Use sed to remove single-line comments before parsing with jq
extensions=$(sed 's|//.*||g' "$WORKSPACE_DIR"/.vscode/extensions.json | jq -r '.recommendations[]')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sufficient as a quick fix. However, since both scripts will have Node available, we may want to consider parsing and stringifying the string using Node, as that should also eliminate multiline comments and comments after a field or value. (or even use a third-party NPM package to do so).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be great. We can also get rid of jq then.

@matifali matifali merged commit d78925d into main Feb 6, 2025
2 checks passed
@matifali matifali deleted the atif/vscode-web-handle-json-commnets branch February 6, 2025 14:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vscode-web: auto installing extensions fails if json has comments
2 participants