aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorSeivan Heidari <[email protected]>2019-11-18 01:37:18 +0000
committerSeivan Heidari <[email protected]>2019-11-18 01:37:18 +0000
commite5bbb476800c9bf24820701ec9252153ba07cf6a (patch)
tree3cf9360d404fa638726fd42b81c6bc4a724a78f1 /editors
parent166636ba77adcf5bf2c4ef935e9aa75e20f25e10 (diff)
Readding jsonc parser because of https://github.com/rust-analyzer/rust-analyzer/pull/2061\#discussion_r344783715
Diffstat (limited to 'editors')
-rw-r--r--editors/code/package-lock.json5
-rw-r--r--editors/code/package.json3
-rw-r--r--editors/code/src/scopes.ts4
3 files changed, 9 insertions, 3 deletions
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json
index 9c55c257f..a41497a23 100644
--- a/editors/code/package-lock.json
+++ b/editors/code/package-lock.json
@@ -720,6 +720,11 @@
720 "esprima": "^4.0.0" 720 "esprima": "^4.0.0"
721 } 721 }
722 }, 722 },
723 "jsonc-parser": {
724 "version": "2.2.0",
725 "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.2.0.tgz",
726 "integrity": "sha512-4fLQxW1j/5fWj6p78vAlAafoCKtuBm6ghv+Ij5W2DrDx0qE+ZdEl2c6Ko1mgJNF5ftX1iEWQQ4Ap7+3GlhjkOA=="
727 },
723 "lcid": { 728 "lcid": {
724 "version": "2.0.0", 729 "version": "2.0.0",
725 "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", 730 "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
diff --git a/editors/code/package.json b/editors/code/package.json
index 5c5be34db..fbf675d46 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -32,7 +32,8 @@
32 }, 32 },
33 "dependencies": { 33 "dependencies": {
34 "seedrandom": "^3.0.1", 34 "seedrandom": "^3.0.1",
35 "vscode-languageclient": "^5.3.0-next.4" 35 "vscode-languageclient": "^5.3.0-next.4",
36 "jsonc-parser": "^2.1.0"
36 }, 37 },
37 "devDependencies": { 38 "devDependencies": {
38 "@types/glob": "^7.1.1", 39 "@types/glob": "^7.1.1",
diff --git a/editors/code/src/scopes.ts b/editors/code/src/scopes.ts
index 98099872c..8f288d761 100644
--- a/editors/code/src/scopes.ts
+++ b/editors/code/src/scopes.ts
@@ -1,4 +1,5 @@
1import * as fs from 'fs'; 1import * as fs from 'fs';
2import * as jsonc from 'jsonc-parser';
2import * as path from 'path'; 3import * as path from 'path';
3import * as vscode from 'vscode'; 4import * as vscode from 'vscode';
4 5
@@ -140,7 +141,6 @@ function readFileText(filePath: string): string {
140 return fs.readFileSync(filePath, 'utf8'); 141 return fs.readFileSync(filePath, 'utf8');
141} 142}
142 143
143// Might need to replace with JSONC if a theme contains comments.
144function parseJSON(content: string): any { 144function parseJSON(content: string): any {
145 return JSON.parse(content); 145 return jsonc.parse(content);
146} 146}