vscode-json-languageservice 4.2.0 → 5.1.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.
- package/CHANGELOG.md +10 -1
- package/SECURITY.md +41 -0
- package/lib/esm/jsonLanguageService.js +22 -22
- package/lib/esm/jsonLanguageTypes.d.ts +3 -1
- package/lib/esm/jsonLanguageTypes.js +3 -2
- package/lib/esm/jsonSchema.d.ts +21 -2
- package/lib/esm/parser/jsonParser.js +488 -488
- package/lib/esm/services/configuration.js +9 -9
- package/lib/esm/services/jsonCompletion.js +280 -290
- package/lib/esm/services/jsonDocumentSymbols.js +88 -99
- package/lib/esm/services/jsonFolding.js +38 -39
- package/lib/esm/services/jsonHover.js +40 -43
- package/lib/esm/services/jsonLinks.js +12 -13
- package/lib/esm/services/jsonSchemaService.js +234 -253
- package/lib/esm/services/jsonSelectionRanges.js +9 -9
- package/lib/esm/services/jsonValidation.js +53 -51
- package/lib/esm/utils/colors.js +7 -8
- package/lib/esm/utils/glob.js +12 -12
- package/lib/esm/utils/json.js +7 -7
- package/lib/esm/utils/objects.js +3 -0
- package/lib/esm/utils/strings.js +3 -3
- package/lib/umd/jsonLanguageService.js +36 -32
- package/lib/umd/jsonLanguageTypes.d.ts +3 -1
- package/lib/umd/jsonLanguageTypes.js +5 -3
- package/lib/umd/jsonSchema.d.ts +21 -2
- package/lib/umd/parser/jsonParser.js +492 -482
- package/lib/umd/services/configuration.js +9 -9
- package/lib/umd/services/jsonCompletion.js +287 -296
- package/lib/umd/services/jsonDocumentSymbols.js +92 -102
- package/lib/umd/services/jsonFolding.js +40 -41
- package/lib/umd/services/jsonHover.js +42 -44
- package/lib/umd/services/jsonLinks.js +13 -14
- package/lib/umd/services/jsonSchemaService.js +241 -257
- package/lib/umd/services/jsonSelectionRanges.js +11 -11
- package/lib/umd/services/jsonValidation.js +56 -53
- package/lib/umd/utils/colors.js +7 -8
- package/lib/umd/utils/glob.js +12 -12
- package/lib/umd/utils/json.js +7 -7
- package/lib/umd/utils/objects.js +5 -1
- package/lib/umd/utils/strings.js +3 -3
- package/package.json +12 -12
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as nls from 'vscode-nls';
|
|
6
|
-
|
|
7
|
-
export
|
|
6
|
+
const localize = nls.loadMessageBundle();
|
|
7
|
+
export const schemaContributions = {
|
|
8
8
|
schemaAssociations: [],
|
|
9
9
|
schemas: {
|
|
10
10
|
// refer to the latest schema
|
|
@@ -462,7 +462,7 @@ export var schemaContributions = {
|
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
};
|
|
465
|
-
|
|
465
|
+
const descriptions = {
|
|
466
466
|
id: localize('schema.json.id', "A unique identifier for the schema."),
|
|
467
467
|
$schema: localize('schema.json.$schema', "The schema to verify this document against."),
|
|
468
468
|
title: localize('schema.json.title', "A descriptive title of the element."),
|
|
@@ -510,19 +510,19 @@ var descriptions = {
|
|
|
510
510
|
then: localize('schema.json.then', "The \"if\" subschema is used for validation when the \"if\" subschema succeeds."),
|
|
511
511
|
else: localize('schema.json.else', "The \"else\" subschema is used for validation when the \"if\" subschema fails.")
|
|
512
512
|
};
|
|
513
|
-
for (
|
|
514
|
-
|
|
515
|
-
for (
|
|
516
|
-
|
|
513
|
+
for (const schemaName in schemaContributions.schemas) {
|
|
514
|
+
const schema = schemaContributions.schemas[schemaName];
|
|
515
|
+
for (const property in schema.properties) {
|
|
516
|
+
let propertyObject = schema.properties[property];
|
|
517
517
|
if (typeof propertyObject === 'boolean') {
|
|
518
518
|
propertyObject = schema.properties[property] = {};
|
|
519
519
|
}
|
|
520
|
-
|
|
520
|
+
const description = descriptions[property];
|
|
521
521
|
if (description) {
|
|
522
522
|
propertyObject['description'] = description;
|
|
523
523
|
}
|
|
524
524
|
else {
|
|
525
|
-
console.log(
|
|
525
|
+
console.log(`${property}: localize('schema.json.${property}', "")`);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
}
|