Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
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