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

Open
joaomoreno opened this issue May 14, 2024 · 0 comments
Open

Silent warning when argv.json has syntax errors #212671

joaomoreno opened this issue May 14, 2024 · 0 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants