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

Commit c4f1e58

Browse files
committed
vscode: Parse settings with comments
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>
1 parent 0c04637 commit c4f1e58

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

generators/app/baseHelper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var util = require('./utils.js');
77
var path = require('path');
88
var process = require('process');
99
var fs = require('fs');
10+
var decomment = require('decomment');
1011

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

126-
data = JSON.parse(data);
127+
data = JSON.parse(decomment(data));
127128

128129
updateSettingsCB(data, true, cb);
129130
});

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"dependencies": {
2626
"chalk": "^1.0.0",
2727
"configstore": "^1.3.0",
28+
"decomment": "^0.9.2",
2829
"node-uuid": "^1.4.7",
2930
"process": "^0.11.2",
3031
"yeoman-generator": "^0.19.0",

0 commit comments

Comments
 (0)