This commit is contained in:
Seivan Heidari 2019-11-18 02:37:18 +01:00
parent 166636ba77
commit e5bbb47680
3 changed files with 9 additions and 3 deletions

View File

@ -720,6 +720,11 @@
"esprima": "^4.0.0"
}
},
"jsonc-parser": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.2.0.tgz",
"integrity": "sha512-4fLQxW1j/5fWj6p78vAlAafoCKtuBm6ghv+Ij5W2DrDx0qE+ZdEl2c6Ko1mgJNF5ftX1iEWQQ4Ap7+3GlhjkOA=="
},
"lcid": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",

View File

@ -32,7 +32,8 @@
},
"dependencies": {
"seedrandom": "^3.0.1",
"vscode-languageclient": "^5.3.0-next.4"
"vscode-languageclient": "^5.3.0-next.4",
"jsonc-parser": "^2.1.0"
},
"devDependencies": {
"@types/glob": "^7.1.1",

View File

@ -1,4 +1,5 @@
import * as fs from 'fs';
import * as jsonc from 'jsonc-parser';
import * as path from 'path';
import * as vscode from 'vscode';
@ -140,7 +141,6 @@ function readFileText(filePath: string): string {
return fs.readFileSync(filePath, 'utf8');
}
// Might need to replace with JSONC if a theme contains comments.
function parseJSON(content: string): any {
return JSON.parse(content);
return jsonc.parse(content);
}