Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
vscode: Parse settings with comments
Browse files Browse the repository at this point in the history
If needed developer can revert the removed comments
at the cost of loosing JSON compliance.

The alternative would be to use an other non standard JSON.parse

Bug: #104
Forwarded: #146
Change-Id: I80f8b290b846f62abaf5b99d424a8cfdfd9f84a1
Signed-off-by: Philippe Coval <p.coval@samsung.com>
  • Loading branch information
rzr committed Oct 25, 2019
1 parent 0c04637 commit c4f1e58
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generators/app/baseHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var util = require('./utils.js');
var path = require('path');
var process = require('process');
var fs = require('fs');
var decomment = require('decomment');

/**
* Represents a base helper for projects.
Expand Down Expand Up @@ -123,7 +124,7 @@ BaseHelper.prototype.updateSettingsJson = function (cb) {
data = data.replace(/^\uFEFF/, '');
}

data = JSON.parse(data);
data = JSON.parse(decomment(data));

updateSettingsCB(data, true, cb);
});
Expand Down
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"dependencies": {
"chalk": "^1.0.0",
"configstore": "^1.3.0",
"decomment": "^0.9.2",
"node-uuid": "^1.4.7",
"process": "^0.11.2",
"yeoman-generator": "^0.19.0",
Expand Down

0 comments on commit c4f1e58

Please sign in to comment.