Readding jsonc parser because of https://github.com/rust-analyzer/rust-analyzer/pull/2061\#discussion_r344783715
This commit is contained in:
parent
166636ba77
commit
e5bbb47680
5
editors/code/package-lock.json
generated
5
editors/code/package-lock.json
generated
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user