vscode-json-languageservice 3.4.12 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/.nyc_output/0abe3076-16a9-4975-87da-4ecfc24d9226.json +1 -0
  2. package/.nyc_output/5a0d1463-368f-4136-8a80-4c7fda7ca33b.json +1 -0
  3. package/.nyc_output/65e3530f-ee58-4bcb-8484-70eb1822427e.json +1 -0
  4. package/.nyc_output/a37c9066-0aa4-4d91-a56b-17754005a42d.json +1 -0
  5. package/.nyc_output/b7eb272f-3bf3-48c4-9a42-90600332b363.json +1 -0
  6. package/.nyc_output/cabc6994-64f7-4258-bb45-9bb5529b388e.json +1 -0
  7. package/.nyc_output/processinfo/0abe3076-16a9-4975-87da-4ecfc24d9226.json +1 -0
  8. package/.nyc_output/processinfo/5a0d1463-368f-4136-8a80-4c7fda7ca33b.json +1 -0
  9. package/.nyc_output/processinfo/65e3530f-ee58-4bcb-8484-70eb1822427e.json +1 -0
  10. package/.nyc_output/processinfo/a37c9066-0aa4-4d91-a56b-17754005a42d.json +1 -0
  11. package/.nyc_output/processinfo/b7eb272f-3bf3-48c4-9a42-90600332b363.json +1 -0
  12. package/.nyc_output/processinfo/cabc6994-64f7-4258-bb45-9bb5529b388e.json +1 -0
  13. package/.nyc_output/processinfo/index.json +1 -0
  14. package/CHANGELOG.md +13 -1
  15. package/coverage/lcov-report/base.css +224 -0
  16. package/coverage/lcov-report/block-navigation.js +79 -0
  17. package/coverage/lcov-report/favicon.png +0 -0
  18. package/coverage/lcov-report/index.html +156 -0
  19. package/coverage/lcov-report/prettify.css +1 -0
  20. package/coverage/lcov-report/prettify.js +2 -0
  21. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  22. package/coverage/lcov-report/sorter.js +170 -0
  23. package/coverage/lcov-report/src/index.html +126 -0
  24. package/coverage/lcov-report/src/jsonLanguageService.ts.html +383 -0
  25. package/coverage/lcov-report/src/jsonLanguageTypes.ts.html +968 -0
  26. package/coverage/lcov-report/src/parser/index.html +111 -0
  27. package/coverage/lcov-report/src/parser/jsonParser.ts.html +3860 -0
  28. package/coverage/lcov-report/src/services/configuration.ts.html +1679 -0
  29. package/coverage/lcov-report/src/services/index.html +216 -0
  30. package/coverage/lcov-report/src/services/jsonCompletion.ts.html +2843 -0
  31. package/coverage/lcov-report/src/services/jsonDocumentSymbols.ts.html +911 -0
  32. package/coverage/lcov-report/src/services/jsonFolding.ts.html +455 -0
  33. package/coverage/lcov-report/src/services/jsonHover.ts.html +461 -0
  34. package/coverage/lcov-report/src/services/jsonSchemaService.ts.html +1895 -0
  35. package/coverage/lcov-report/src/services/jsonSelectionRanges.ts.html +311 -0
  36. package/coverage/lcov-report/src/services/jsonValidation.ts.html +560 -0
  37. package/coverage/lcov-report/src/utils/colors.ts.html +299 -0
  38. package/coverage/lcov-report/src/utils/index.html +156 -0
  39. package/coverage/lcov-report/src/utils/json.ts.html +206 -0
  40. package/coverage/lcov-report/src/utils/objects.ts.html +296 -0
  41. package/coverage/lcov-report/src/utils/strings.ts.html +224 -0
  42. package/coverage/lcov.info +4219 -0
  43. package/lib/esm/jsonLanguageService.d.ts +2 -1
  44. package/lib/esm/jsonLanguageService.js +3 -1
  45. package/lib/esm/jsonLanguageTypes.d.ts +4 -2
  46. package/lib/esm/jsonSchema.d.ts +1 -0
  47. package/lib/esm/parser/jsonParser.js +31 -30
  48. package/lib/esm/services/configuration.js +2 -2
  49. package/lib/esm/services/jsonCompletion.js +39 -33
  50. package/lib/esm/services/jsonDefinition.js +83 -0
  51. package/lib/esm/services/jsonDocumentSymbols.js +4 -4
  52. package/lib/esm/services/jsonHover.js +5 -5
  53. package/lib/esm/services/jsonSchemaService.js +90 -79
  54. package/lib/esm/services/jsonValidation.js +9 -8
  55. package/lib/esm/utils/colors.js +2 -2
  56. package/lib/umd/jsonLanguageService.d.ts +2 -1
  57. package/lib/umd/jsonLanguageService.js +4 -2
  58. package/lib/umd/jsonLanguageTypes.d.ts +4 -2
  59. package/lib/umd/jsonSchema.d.ts +1 -0
  60. package/lib/umd/parser/jsonParser.js +31 -30
  61. package/lib/umd/services/configuration.js +2 -2
  62. package/lib/umd/services/jsonCompletion.js +39 -33
  63. package/lib/umd/services/jsonDefinition.js +96 -0
  64. package/lib/umd/services/jsonDocumentSymbols.js +4 -4
  65. package/lib/umd/services/jsonHover.js +5 -5
  66. package/lib/umd/services/jsonSchemaService.js +90 -79
  67. package/lib/umd/services/jsonValidation.js +9 -8
  68. package/lib/umd/utils/colors.js +2 -2
  69. package/package.json +19 -13
@@ -20,24 +20,40 @@
20
20
  var nls = require("vscode-nls");
21
21
  var localize = nls.loadMessageBundle();
22
22
  var FilePatternAssociation = /** @class */ (function () {
23
- function FilePatternAssociation(pattern) {
23
+ function FilePatternAssociation(pattern, uris) {
24
+ this.patternRegExps = [];
25
+ this.isInclude = [];
24
26
  try {
25
- this.patternRegExp = new RegExp(Strings.convertSimple2RegExpPattern(pattern) + '$');
27
+ for (var _i = 0, pattern_1 = pattern; _i < pattern_1.length; _i++) {
28
+ var p = pattern_1[_i];
29
+ var include = p[0] !== '!';
30
+ if (!include) {
31
+ p = p.substring(1);
32
+ }
33
+ this.patternRegExps.push(new RegExp(Strings.convertSimple2RegExpPattern(p) + '$'));
34
+ this.isInclude.push(include);
35
+ }
36
+ this.uris = uris;
26
37
  }
27
38
  catch (e) {
28
39
  // invalid pattern
29
- this.patternRegExp = null;
40
+ this.patternRegExps.length = 0;
41
+ this.isInclude.length = 0;
42
+ this.uris = [];
30
43
  }
31
- this.schemas = [];
32
44
  }
33
- FilePatternAssociation.prototype.addSchema = function (id) {
34
- this.schemas.push(id);
35
- };
36
45
  FilePatternAssociation.prototype.matchesPattern = function (fileName) {
37
- return this.patternRegExp && this.patternRegExp.test(fileName);
46
+ var match = false;
47
+ for (var i = 0; i < this.patternRegExps.length; i++) {
48
+ var regExp = this.patternRegExps[i];
49
+ if (regExp.test(fileName)) {
50
+ match = this.isInclude[i];
51
+ }
52
+ }
53
+ return match;
38
54
  };
39
- FilePatternAssociation.prototype.getSchemas = function () {
40
- return this.schemas;
55
+ FilePatternAssociation.prototype.getURIs = function () {
56
+ return this.uris;
41
57
  };
42
58
  return FilePatternAssociation;
43
59
  }());
@@ -66,8 +82,8 @@
66
82
  return this.resolvedSchema;
67
83
  };
68
84
  SchemaHandle.prototype.clearSchema = function () {
69
- this.resolvedSchema = null;
70
- this.unresolvedSchema = null;
85
+ this.resolvedSchema = undefined;
86
+ this.unresolvedSchema = undefined;
71
87
  this.dependencies = {};
72
88
  };
73
89
  return SchemaHandle;
@@ -88,7 +104,11 @@
88
104
  this.errors = errors;
89
105
  }
90
106
  ResolvedSchema.prototype.getSection = function (path) {
91
- return Parser.asSchema(this.getSectionRecursive(path, this.schema));
107
+ var schemaRef = this.getSectionRecursive(path, this.schema);
108
+ if (schemaRef) {
109
+ return Parser.asSchema(schemaRef);
110
+ }
111
+ return undefined;
92
112
  };
93
113
  ResolvedSchema.prototype.getSectionRecursive = function (path, schema) {
94
114
  if (!schema || typeof schema === 'boolean' || path.length === 0) {
@@ -121,7 +141,7 @@
121
141
  return this.getSectionRecursive(path, schema.items);
122
142
  }
123
143
  }
124
- return null;
144
+ return undefined;
125
145
  };
126
146
  return ResolvedSchema;
127
147
  }());
@@ -133,10 +153,9 @@
133
153
  this.promiseConstructor = promiseConstructor || Promise;
134
154
  this.callOnDispose = [];
135
155
  this.contributionSchemas = {};
136
- this.contributionAssociations = {};
156
+ this.contributionAssociations = [];
137
157
  this.schemasById = {};
138
158
  this.filePatternAssociations = [];
139
- this.filePatternAssociationById = {};
140
159
  this.registeredSchemasIds = {};
141
160
  }
142
161
  JSONSchemaService.prototype.getRegisteredSchemaIds = function (filter) {
@@ -160,7 +179,7 @@
160
179
  JSONSchemaService.prototype.onResourceChange = function (uri) {
161
180
  var _this = this;
162
181
  var hasChanges = false;
163
- uri = this.normalizeId(uri);
182
+ uri = normalizeId(uri);
164
183
  var toWalk = [uri];
165
184
  var all = Object.keys(this.schemasById).map(function (key) { return _this.schemasById[key]; });
166
185
  while (toWalk.length) {
@@ -179,34 +198,21 @@
179
198
  }
180
199
  return hasChanges;
181
200
  };
182
- JSONSchemaService.prototype.normalizeId = function (id) {
183
- // remove trailing '#', normalize drive capitalization
184
- try {
185
- return vscode_uri_1.URI.parse(id).toString();
186
- }
187
- catch (e) {
188
- return id;
189
- }
190
- };
191
201
  JSONSchemaService.prototype.setSchemaContributions = function (schemaContributions) {
192
202
  if (schemaContributions.schemas) {
193
203
  var schemas = schemaContributions.schemas;
194
204
  for (var id in schemas) {
195
- var normalizedId = this.normalizeId(id);
205
+ var normalizedId = normalizeId(id);
196
206
  this.contributionSchemas[normalizedId] = this.addSchemaHandle(normalizedId, schemas[id]);
197
207
  }
198
208
  }
199
- if (schemaContributions.schemaAssociations) {
209
+ if (Array.isArray(schemaContributions.schemaAssociations)) {
200
210
  var schemaAssociations = schemaContributions.schemaAssociations;
201
- for (var pattern in schemaAssociations) {
202
- var associations = schemaAssociations[pattern];
203
- this.contributionAssociations[pattern] = associations;
204
- var fpa = this.getOrAddFilePatternAssociation(pattern);
205
- for (var _i = 0, associations_1 = associations; _i < associations_1.length; _i++) {
206
- var schemaId = associations_1[_i];
207
- var id = this.normalizeId(schemaId);
208
- fpa.addSchema(id);
209
- }
211
+ for (var _i = 0, schemaAssociations_1 = schemaAssociations; _i < schemaAssociations_1.length; _i++) {
212
+ var schemaAssociation = schemaAssociations_1[_i];
213
+ var uris = schemaAssociation.uris.map(normalizeId);
214
+ var association = this.addFilePatternAssociation(schemaAssociation.pattern, uris);
215
+ this.contributionAssociations.push(association);
210
216
  }
211
217
  }
212
218
  };
@@ -218,52 +224,41 @@
218
224
  JSONSchemaService.prototype.getOrAddSchemaHandle = function (id, unresolvedSchemaContent) {
219
225
  return this.schemasById[id] || this.addSchemaHandle(id, unresolvedSchemaContent);
220
226
  };
221
- JSONSchemaService.prototype.getOrAddFilePatternAssociation = function (pattern) {
222
- var fpa = this.filePatternAssociationById[pattern];
223
- if (!fpa) {
224
- fpa = new FilePatternAssociation(pattern);
225
- this.filePatternAssociationById[pattern] = fpa;
226
- this.filePatternAssociations.push(fpa);
227
- }
227
+ JSONSchemaService.prototype.addFilePatternAssociation = function (pattern, uris) {
228
+ var fpa = new FilePatternAssociation(pattern, uris);
229
+ this.filePatternAssociations.push(fpa);
228
230
  return fpa;
229
231
  };
230
232
  JSONSchemaService.prototype.registerExternalSchema = function (uri, filePatterns, unresolvedSchemaContent) {
231
- if (filePatterns === void 0) { filePatterns = null; }
232
- var id = this.normalizeId(uri);
233
+ var id = normalizeId(uri);
233
234
  this.registeredSchemasIds[id] = true;
235
+ this.cachedSchemaForResource = undefined;
234
236
  if (filePatterns) {
235
- for (var _i = 0, filePatterns_1 = filePatterns; _i < filePatterns_1.length; _i++) {
236
- var pattern = filePatterns_1[_i];
237
- this.getOrAddFilePatternAssociation(pattern).addSchema(id);
238
- }
237
+ this.addFilePatternAssociation(filePatterns, [uri]);
239
238
  }
240
239
  return unresolvedSchemaContent ? this.addSchemaHandle(id, unresolvedSchemaContent) : this.getOrAddSchemaHandle(id);
241
240
  };
242
241
  JSONSchemaService.prototype.clearExternalSchemas = function () {
243
242
  this.schemasById = {};
244
243
  this.filePatternAssociations = [];
245
- this.filePatternAssociationById = {};
246
244
  this.registeredSchemasIds = {};
245
+ this.cachedSchemaForResource = undefined;
247
246
  for (var id in this.contributionSchemas) {
248
247
  this.schemasById[id] = this.contributionSchemas[id];
249
248
  this.registeredSchemasIds[id] = true;
250
249
  }
251
- for (var pattern in this.contributionAssociations) {
252
- var fpa = this.getOrAddFilePatternAssociation(pattern);
253
- for (var _i = 0, _a = this.contributionAssociations[pattern]; _i < _a.length; _i++) {
254
- var schemaId = _a[_i];
255
- var id = this.normalizeId(schemaId);
256
- fpa.addSchema(id);
257
- }
250
+ for (var _i = 0, _a = this.contributionAssociations; _i < _a.length; _i++) {
251
+ var contributionAssociation = _a[_i];
252
+ this.filePatternAssociations.push(contributionAssociation);
258
253
  }
259
254
  };
260
255
  JSONSchemaService.prototype.getResolvedSchema = function (schemaId) {
261
- var id = this.normalizeId(schemaId);
256
+ var id = normalizeId(schemaId);
262
257
  var schemaHandle = this.schemasById[id];
263
258
  if (schemaHandle) {
264
259
  return schemaHandle.getResolvedSchema();
265
260
  }
266
- return this.promise.resolve(null);
261
+ return this.promise.resolve(undefined);
267
262
  };
268
263
  JSONSchemaService.prototype.loadSchema = function (url) {
269
264
  if (!this.requestService) {
@@ -298,7 +293,7 @@
298
293
  var resolveErrors = schemaToResolve.errors.slice(0);
299
294
  var schema = schemaToResolve.schema;
300
295
  if (schema.$schema) {
301
- var id = this.normalizeId(schema.$schema);
296
+ var id = normalizeId(schema.$schema);
302
297
  if (id === 'http://json-schema.org/draft-03/schema') {
303
298
  return this.promise.resolve(new ResolvedSchema({}, [localize('json.schema.draft03.notsupported', "Draft-03 schemas are not supported.")]));
304
299
  }
@@ -321,7 +316,8 @@
321
316
  });
322
317
  return current;
323
318
  };
324
- var merge = function (target, sourceRoot, sourceURI, path) {
319
+ var merge = function (target, sourceRoot, sourceURI, refSegment) {
320
+ var path = refSegment ? decodeURIComponent(refSegment) : undefined;
325
321
  var section = findSection(sourceRoot, path);
326
322
  if (section) {
327
323
  for (var key in section) {
@@ -334,19 +330,19 @@
334
330
  resolveErrors.push(localize('json.schema.invalidref', '$ref \'{0}\' in \'{1}\' can not be resolved.', path, sourceURI));
335
331
  }
336
332
  };
337
- var resolveExternalLink = function (node, uri, linkPath, parentSchemaURL, parentSchemaDependencies) {
333
+ var resolveExternalLink = function (node, uri, refSegment, parentSchemaURL, parentSchemaDependencies) {
338
334
  if (contextService && !/^\w+:\/\/.*/.test(uri)) {
339
335
  uri = contextService.resolveRelativePath(uri, parentSchemaURL);
340
336
  }
341
- uri = _this.normalizeId(uri);
337
+ uri = normalizeId(uri);
342
338
  var referencedHandle = _this.getOrAddSchemaHandle(uri);
343
339
  return referencedHandle.getUnresolvedSchema().then(function (unresolvedSchema) {
344
340
  parentSchemaDependencies[uri] = true;
345
341
  if (unresolvedSchema.errors.length) {
346
- var loc = linkPath ? uri + '#' + linkPath : uri;
342
+ var loc = refSegment ? uri + '#' + refSegment : uri;
347
343
  resolveErrors.push(localize('json.schema.problemloadingref', 'Problems loading reference \'{0}\': {1}', loc, unresolvedSchema.errors[0]));
348
344
  }
349
- merge(node, unresolvedSchema.schema, uri, linkPath);
345
+ merge(node, unresolvedSchema.schema, uri, refSegment);
350
346
  return resolveRefs(node, unresolvedSchema.schema, uri, referencedHandle.dependencies);
351
347
  });
352
348
  };
@@ -377,7 +373,8 @@
377
373
  for (var _a = 0, maps_1 = maps; _a < maps_1.length; _a++) {
378
374
  var map = maps_1[_a];
379
375
  if (typeof map === 'object') {
380
- for (var key in map) {
376
+ for (var k in map) {
377
+ var key = k;
381
378
  var entry = map[key];
382
379
  if (typeof entry === 'object') {
383
380
  toWalk.push(entry);
@@ -441,22 +438,28 @@
441
438
  if (document && document.root && document.root.type === 'object') {
442
439
  var schemaProperties = document.root.properties.filter(function (p) { return (p.keyNode.value === '$schema') && p.valueNode && p.valueNode.type === 'string'; });
443
440
  if (schemaProperties.length > 0) {
444
- var schemeId = Parser.getNodeValue(schemaProperties[0].valueNode);
445
- if (schemeId && Strings.startsWith(schemeId, '.') && this.contextService) {
446
- schemeId = this.contextService.resolveRelativePath(schemeId, resource);
447
- }
448
- if (schemeId) {
449
- var id = this.normalizeId(schemeId);
450
- return this.getOrAddSchemaHandle(id).getResolvedSchema();
441
+ var valueNode = schemaProperties[0].valueNode;
442
+ if (valueNode && valueNode.type === 'string') {
443
+ var schemeId = Parser.getNodeValue(valueNode);
444
+ if (schemeId && Strings.startsWith(schemeId, '.') && this.contextService) {
445
+ schemeId = this.contextService.resolveRelativePath(schemeId, resource);
446
+ }
447
+ if (schemeId) {
448
+ var id = normalizeId(schemeId);
449
+ return this.getOrAddSchemaHandle(id).getResolvedSchema();
450
+ }
451
451
  }
452
452
  }
453
453
  }
454
+ if (this.cachedSchemaForResource && this.cachedSchemaForResource.resource === resource) {
455
+ return this.cachedSchemaForResource.resolvedSchema;
456
+ }
454
457
  var seen = Object.create(null);
455
458
  var schemas = [];
456
459
  for (var _i = 0, _a = this.filePatternAssociations; _i < _a.length; _i++) {
457
460
  var entry = _a[_i];
458
461
  if (entry.matchesPattern(resource)) {
459
- for (var _b = 0, _c = entry.getSchemas(); _b < _c.length; _b++) {
462
+ for (var _b = 0, _c = entry.getURIs(); _b < _c.length; _b++) {
460
463
  var schemaId = _c[_b];
461
464
  if (!seen[schemaId]) {
462
465
  schemas.push(schemaId);
@@ -465,10 +468,9 @@
465
468
  }
466
469
  }
467
470
  }
468
- if (schemas.length > 0) {
469
- return this.createCombinedSchema(resource, schemas).getResolvedSchema();
470
- }
471
- return this.promise.resolve(null);
471
+ var resolvedSchema = schemas.length > 0 ? this.createCombinedSchema(resource, schemas).getResolvedSchema() : this.promise.resolve(undefined);
472
+ this.cachedSchemaForResource = { resource: resource, resolvedSchema: resolvedSchema };
473
+ return resolvedSchema;
472
474
  };
473
475
  JSONSchemaService.prototype.createCombinedSchema = function (resource, schemaIds) {
474
476
  if (schemaIds.length === 1) {
@@ -485,6 +487,15 @@
485
487
  return JSONSchemaService;
486
488
  }());
487
489
  exports.JSONSchemaService = JSONSchemaService;
490
+ function normalizeId(id) {
491
+ // remove trailing '#', normalize drive capitalization
492
+ try {
493
+ return vscode_uri_1.URI.parse(id).toString();
494
+ }
495
+ catch (e) {
496
+ return id;
497
+ }
498
+ }
488
499
  function toDisplayString(url) {
489
500
  try {
490
501
  var uri = vscode_uri_1.URI.parse(url);
@@ -27,7 +27,7 @@
27
27
  JSONValidation.prototype.configure = function (raw) {
28
28
  if (raw) {
29
29
  this.validationEnabled = raw.validate;
30
- this.commentSeverity = raw.allowComments ? void 0 : jsonLanguageTypes_1.DiagnosticSeverity.Error;
30
+ this.commentSeverity = raw.allowComments ? undefined : jsonLanguageTypes_1.DiagnosticSeverity.Error;
31
31
  }
32
32
  };
33
33
  JSONValidation.prototype.doValidation = function (textDocument, jsonDocument, documentSettings, schema) {
@@ -51,7 +51,7 @@
51
51
  if (schema) {
52
52
  if (schema.errors.length && jsonDocument.root) {
53
53
  var astRoot = jsonDocument.root;
54
- var property = astRoot.type === 'object' ? astRoot.properties[0] : null;
54
+ var property = astRoot.type === 'object' ? astRoot.properties[0] : undefined;
55
55
  if (property && property.keyNode.value === '$schema') {
56
56
  var node = property.valueNode || property;
57
57
  var range = jsonLanguageTypes_1.Range.create(textDocument.positionAt(node.offset), textDocument.positionAt(node.offset + node.length));
@@ -69,10 +69,10 @@
69
69
  }
70
70
  }
71
71
  if (schemaAllowsComments(schema.schema)) {
72
- commentSeverity = void 0;
72
+ commentSeverity = undefined;
73
73
  }
74
74
  if (schemaAllowsTrailingCommas(schema.schema)) {
75
- trailingCommaSeverity = void 0;
75
+ trailingCommaSeverity = undefined;
76
76
  }
77
77
  }
78
78
  for (var _i = 0, _a = jsonDocument.syntaxErrors; _i < _a.length; _i++) {
@@ -129,8 +129,9 @@
129
129
  if (objects_1.isBoolean(schemaRef.allowTrailingCommas)) {
130
130
  return schemaRef.allowTrailingCommas;
131
131
  }
132
- if (objects_1.isBoolean(schemaRef['allowsTrailingCommas'])) { // deprecated
133
- return schemaRef['allowsTrailingCommas'];
132
+ var deprSchemaRef = schemaRef;
133
+ if (objects_1.isBoolean(deprSchemaRef['allowsTrailingCommas'])) { // deprecated
134
+ return deprSchemaRef['allowsTrailingCommas'];
134
135
  }
135
136
  if (schemaRef.allOf) {
136
137
  for (var _i = 0, _a = schemaRef.allOf; _i < _a.length; _i++) {
@@ -148,8 +149,8 @@
148
149
  switch (severityLevel) {
149
150
  case 'error': return jsonLanguageTypes_1.DiagnosticSeverity.Error;
150
151
  case 'warning': return jsonLanguageTypes_1.DiagnosticSeverity.Warning;
151
- case 'ignore': return void 0;
152
+ case 'ignore': return undefined;
152
153
  }
153
- return void 0;
154
+ return undefined;
154
155
  }
155
156
  });
@@ -36,7 +36,7 @@
36
36
  exports.hexDigit = hexDigit;
37
37
  function colorFromHex(text) {
38
38
  if (text[0] !== '#') {
39
- return null;
39
+ return undefined;
40
40
  }
41
41
  switch (text.length) {
42
42
  case 4:
@@ -68,7 +68,7 @@
68
68
  alpha: (hexDigit(text.charCodeAt(7)) * 0x10 + hexDigit(text.charCodeAt(8))) / 255.0
69
69
  };
70
70
  }
71
- return null;
71
+ return undefined;
72
72
  }
73
73
  exports.colorFromHex = colorFromHex;
74
74
  function colorFrom256RGB(red, green, blue, alpha) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vscode-json-languageservice",
3
- "version": "3.4.12",
3
+ "version": "3.7.0",
4
4
  "description": "Language service for JSON",
5
5
  "main": "./lib/umd/jsonLanguageService.js",
6
6
  "typings": "./lib/umd/jsonLanguageService",
@@ -15,19 +15,22 @@
15
15
  "url": "https://github.com/Microsoft/vscode-json-languageservice"
16
16
  },
17
17
  "devDependencies": {
18
- "@types/mocha": "^5.2.7",
18
+ "@types/mocha": "^7.0.2",
19
19
  "@types/node": "^10.12.21",
20
- "mocha": "^7.0.0",
21
- "rimraf": "^3.0.0",
22
- "tslint": "^6.0.0",
23
- "typescript": "^3.7.5"
20
+ "@typescript-eslint/eslint-plugin": "^3.1.0",
21
+ "@typescript-eslint/parser": "^3.1.0",
22
+ "eslint": "^7.1.0",
23
+ "mocha": "^7.2.0",
24
+ "nyc": "^15.0.1",
25
+ "rimraf": "^3.0.2",
26
+ "typescript": "^3.8.3"
24
27
  },
25
28
  "dependencies": {
26
- "jsonc-parser": "^2.2.0",
27
- "vscode-languageserver-textdocument": "^1.0.1-next.1",
28
- "vscode-languageserver-types": "^3.15.0",
29
- "vscode-nls": "^4.1.1",
30
- "vscode-uri": "^2.1.1"
29
+ "jsonc-parser": "^2.2.1",
30
+ "vscode-languageserver-textdocument": "^1.0.1",
31
+ "vscode-languageserver-types": "^3.15.1",
32
+ "vscode-nls": "^4.1.2",
33
+ "vscode-uri": "^2.1.2"
31
34
  },
32
35
  "scripts": {
33
36
  "prepublishOnly": "npm run clean && npm run compile-esm && npm run test && npm run remove-sourcemap-refs",
@@ -37,8 +40,11 @@
37
40
  "clean": "rimraf lib",
38
41
  "remove-sourcemap-refs": "node ./build/remove-sourcemap-refs.js",
39
42
  "watch": "tsc -w -p ./src",
40
- "test": "npm run compile && mocha && npm run lint",
41
- "lint": "tslint src/**/*.ts",
43
+ "pretest": "npm run compile",
44
+ "test": "mocha",
45
+ "posttest": "npm run lint",
46
+ "coverage": "nyc -r lcov npm run test",
47
+ "lint": "eslint src/**/*.ts",
42
48
  "install-types-next": "npm install vscode-languageserver-types@next -f -S && npm install vscode-languageserver-textdocument@next -f -S",
43
49
  "preversion": "npm test",
44
50
  "postversion": "git push && git push --tags"