Skip to content
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

Silent warning when argv.json has syntax errors #212671

Closed
joaomoreno opened this issue May 14, 2024 · 2 comments
Closed

Silent warning when argv.json has syntax errors #212671

joaomoreno opened this issue May 14, 2024 · 2 comments
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@joaomoreno
Copy link
Member

From #212664

It seems that if the argv.json file has a syntax error (ie trailing comma), then we silently ignore all properties within. This is the reason why crash reporting wasn't enabled for me in #212664. My full file was:

// This configuration file allows you to pass permanent command line arguments to VS Code.
// Only a subset of arguments is currently supported to reduce the likelihood of breaking
// the installation.
//
// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT
//
// NOTE: Changing this file requires a restart of VS Code.
{
	// Use software rendering instead of hardware accelerated rendering.
	// This can help in cases where you see rendering issues in VS Code.
	// "disable-hardware-acceleration": true,
	// Allows to disable crash reporting.
	// Should restart the app if the value is changed.
	"enable-crash-reporter": true,
	// Unique id used for correlating crash reports sent from this instance.
	// Do not edit this value.
	"crash-reporter-id": "2f300b31-7453-4506-97d0-93411b2c21c7",
	"locale": "en",
	// "log-level": "trace"
}

Notice the trailing comma after locale.

A few ideas:

  • We should further sanitize the JSON such that trailing commas are removed before passing it to JSON.parse.
  • We should also show a warning notification on startup so the user is aware of the issue, with an action to open the file.
@deepak1556 deepak1556 added the bug Issue identified by VS Code Team member as probable bug label May 14, 2024
@deepak1556 deepak1556 added this to the May 2024 milestone May 14, 2024
@deepak1556 deepak1556 removed this from the May 2024 milestone May 28, 2024
@bpasero bpasero self-assigned this Jun 14, 2024
@bpasero bpasero added this to the June 2024 milestone Jun 14, 2024
@bpasero
Copy link
Member

bpasero commented Jun 14, 2024

#215551 adds support to parse including trailing commas and shows this warning if it fails on startup:

image

@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jun 19, 2024
@bpasero bpasero added the author-verification-requested Issues potentially verifiable by issue author label Jun 19, 2024
@vscodenpa
Copy link

This bug has been fixed in the latest release of VS Code Insiders!

@joaomoreno, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version c2e20cb of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

@connor4312 connor4312 added the verified Verification succeeded label Jun 26, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Aug 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants