vscode-json-languageservice 5.0.0 → 5.1.1
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 -2
- package/lib/esm/jsonContributions.d.ts +17 -17
- package/lib/esm/jsonContributions.js +1 -1
- package/lib/esm/jsonLanguageService.d.ts +29 -29
- package/lib/esm/jsonLanguageService.js +66 -66
- package/lib/esm/jsonLanguageTypes.d.ts +292 -279
- package/lib/esm/jsonLanguageTypes.js +55 -46
- package/lib/esm/jsonSchema.d.ts +89 -89
- package/lib/esm/jsonSchema.js +1 -1
- package/lib/esm/parser/jsonParser.js +1236 -1214
- package/lib/esm/services/configuration.js +528 -528
- package/lib/esm/services/jsonCompletion.js +924 -918
- package/lib/esm/services/jsonDocumentSymbols.js +267 -267
- package/lib/esm/services/jsonFolding.js +120 -120
- package/lib/esm/services/jsonHover.js +109 -109
- package/lib/esm/services/jsonLinks.js +72 -72
- package/lib/esm/services/jsonSchemaService.js +593 -586
- package/lib/esm/services/jsonSelectionRanges.js +61 -61
- package/lib/esm/services/jsonValidation.js +151 -151
- package/lib/esm/utils/colors.js +68 -68
- package/lib/esm/utils/glob.js +124 -124
- package/lib/esm/utils/json.js +42 -42
- package/lib/esm/utils/objects.js +68 -68
- package/lib/esm/utils/strings.js +79 -64
- package/lib/umd/jsonContributions.d.ts +17 -17
- package/lib/umd/jsonContributions.js +12 -12
- package/lib/umd/jsonLanguageService.d.ts +29 -29
- package/lib/umd/jsonLanguageService.js +94 -90
- package/lib/umd/jsonLanguageTypes.d.ts +292 -279
- package/lib/umd/jsonLanguageTypes.js +103 -93
- package/lib/umd/jsonSchema.d.ts +89 -89
- package/lib/umd/jsonSchema.js +12 -12
- package/lib/umd/parser/jsonParser.js +1265 -1243
- package/lib/umd/services/configuration.js +541 -541
- package/lib/umd/services/jsonCompletion.js +938 -932
- package/lib/umd/services/jsonDocumentSymbols.js +281 -281
- package/lib/umd/services/jsonFolding.js +134 -134
- package/lib/umd/services/jsonHover.js +123 -123
- package/lib/umd/services/jsonLinks.js +86 -86
- package/lib/umd/services/jsonSchemaService.js +609 -602
- package/lib/umd/services/jsonSelectionRanges.js +75 -75
- package/lib/umd/services/jsonValidation.js +165 -165
- package/lib/umd/utils/colors.js +84 -84
- package/lib/umd/utils/glob.js +138 -138
- package/lib/umd/utils/json.js +56 -56
- package/lib/umd/utils/objects.js +87 -87
- package/lib/umd/utils/strings.js +98 -82
- package/package.json +11 -10
|
@@ -1,46 +1,55 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Range, Position, MarkupContent, MarkupKind, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, CompletionItemTag, InsertTextFormat, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, CodeActionContext, Command, CodeAction, DocumentHighlight, DocumentLink, WorkspaceEdit, TextEdit, CodeActionKind, TextDocumentEdit, VersionedTextDocumentIdentifier, DocumentHighlightKind } from 'vscode-languageserver-types';
|
|
6
|
-
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
7
|
-
export { TextDocument, Range, Position, MarkupContent, MarkupKind, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, CompletionItemTag, InsertTextFormat, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, CodeActionContext, Command, CodeAction, DocumentHighlight, DocumentLink, WorkspaceEdit, TextEdit, CodeActionKind, TextDocumentEdit, VersionedTextDocumentIdentifier, DocumentHighlightKind };
|
|
8
|
-
/**
|
|
9
|
-
* Error codes used by diagnostics
|
|
10
|
-
*/
|
|
11
|
-
export var ErrorCode;
|
|
12
|
-
(function (ErrorCode) {
|
|
13
|
-
ErrorCode[ErrorCode["Undefined"] = 0] = "Undefined";
|
|
14
|
-
ErrorCode[ErrorCode["EnumValueMismatch"] = 1] = "EnumValueMismatch";
|
|
15
|
-
ErrorCode[ErrorCode["Deprecated"] = 2] = "Deprecated";
|
|
16
|
-
ErrorCode[ErrorCode["UnexpectedEndOfComment"] = 257] = "UnexpectedEndOfComment";
|
|
17
|
-
ErrorCode[ErrorCode["UnexpectedEndOfString"] = 258] = "UnexpectedEndOfString";
|
|
18
|
-
ErrorCode[ErrorCode["UnexpectedEndOfNumber"] = 259] = "UnexpectedEndOfNumber";
|
|
19
|
-
ErrorCode[ErrorCode["InvalidUnicode"] = 260] = "InvalidUnicode";
|
|
20
|
-
ErrorCode[ErrorCode["InvalidEscapeCharacter"] = 261] = "InvalidEscapeCharacter";
|
|
21
|
-
ErrorCode[ErrorCode["InvalidCharacter"] = 262] = "InvalidCharacter";
|
|
22
|
-
ErrorCode[ErrorCode["PropertyExpected"] = 513] = "PropertyExpected";
|
|
23
|
-
ErrorCode[ErrorCode["CommaExpected"] = 514] = "CommaExpected";
|
|
24
|
-
ErrorCode[ErrorCode["ColonExpected"] = 515] = "ColonExpected";
|
|
25
|
-
ErrorCode[ErrorCode["ValueExpected"] = 516] = "ValueExpected";
|
|
26
|
-
ErrorCode[ErrorCode["CommaOrCloseBacketExpected"] = 517] = "CommaOrCloseBacketExpected";
|
|
27
|
-
ErrorCode[ErrorCode["CommaOrCloseBraceExpected"] = 518] = "CommaOrCloseBraceExpected";
|
|
28
|
-
ErrorCode[ErrorCode["TrailingComma"] = 519] = "TrailingComma";
|
|
29
|
-
ErrorCode[ErrorCode["DuplicateKey"] = 520] = "DuplicateKey";
|
|
30
|
-
ErrorCode[ErrorCode["CommentNotPermitted"] = 521] = "CommentNotPermitted";
|
|
31
|
-
ErrorCode[ErrorCode["SchemaResolveError"] = 768] = "SchemaResolveError";
|
|
32
|
-
ErrorCode[ErrorCode["SchemaUnsupportedFeature"] = 769] = "SchemaUnsupportedFeature";
|
|
33
|
-
})(ErrorCode || (ErrorCode = {}));
|
|
34
|
-
export var
|
|
35
|
-
(function (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Range, Position, DocumentUri, MarkupContent, MarkupKind, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, CompletionItemTag, InsertTextFormat, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, CodeActionContext, Command, CodeAction, DocumentHighlight, DocumentLink, WorkspaceEdit, TextEdit, CodeActionKind, TextDocumentEdit, VersionedTextDocumentIdentifier, DocumentHighlightKind } from 'vscode-languageserver-types';
|
|
6
|
+
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
7
|
+
export { TextDocument, Range, Position, DocumentUri, MarkupContent, MarkupKind, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, CompletionItemTag, InsertTextFormat, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, CodeActionContext, Command, CodeAction, DocumentHighlight, DocumentLink, WorkspaceEdit, TextEdit, CodeActionKind, TextDocumentEdit, VersionedTextDocumentIdentifier, DocumentHighlightKind };
|
|
8
|
+
/**
|
|
9
|
+
* Error codes used by diagnostics
|
|
10
|
+
*/
|
|
11
|
+
export var ErrorCode;
|
|
12
|
+
(function (ErrorCode) {
|
|
13
|
+
ErrorCode[ErrorCode["Undefined"] = 0] = "Undefined";
|
|
14
|
+
ErrorCode[ErrorCode["EnumValueMismatch"] = 1] = "EnumValueMismatch";
|
|
15
|
+
ErrorCode[ErrorCode["Deprecated"] = 2] = "Deprecated";
|
|
16
|
+
ErrorCode[ErrorCode["UnexpectedEndOfComment"] = 257] = "UnexpectedEndOfComment";
|
|
17
|
+
ErrorCode[ErrorCode["UnexpectedEndOfString"] = 258] = "UnexpectedEndOfString";
|
|
18
|
+
ErrorCode[ErrorCode["UnexpectedEndOfNumber"] = 259] = "UnexpectedEndOfNumber";
|
|
19
|
+
ErrorCode[ErrorCode["InvalidUnicode"] = 260] = "InvalidUnicode";
|
|
20
|
+
ErrorCode[ErrorCode["InvalidEscapeCharacter"] = 261] = "InvalidEscapeCharacter";
|
|
21
|
+
ErrorCode[ErrorCode["InvalidCharacter"] = 262] = "InvalidCharacter";
|
|
22
|
+
ErrorCode[ErrorCode["PropertyExpected"] = 513] = "PropertyExpected";
|
|
23
|
+
ErrorCode[ErrorCode["CommaExpected"] = 514] = "CommaExpected";
|
|
24
|
+
ErrorCode[ErrorCode["ColonExpected"] = 515] = "ColonExpected";
|
|
25
|
+
ErrorCode[ErrorCode["ValueExpected"] = 516] = "ValueExpected";
|
|
26
|
+
ErrorCode[ErrorCode["CommaOrCloseBacketExpected"] = 517] = "CommaOrCloseBacketExpected";
|
|
27
|
+
ErrorCode[ErrorCode["CommaOrCloseBraceExpected"] = 518] = "CommaOrCloseBraceExpected";
|
|
28
|
+
ErrorCode[ErrorCode["TrailingComma"] = 519] = "TrailingComma";
|
|
29
|
+
ErrorCode[ErrorCode["DuplicateKey"] = 520] = "DuplicateKey";
|
|
30
|
+
ErrorCode[ErrorCode["CommentNotPermitted"] = 521] = "CommentNotPermitted";
|
|
31
|
+
ErrorCode[ErrorCode["SchemaResolveError"] = 768] = "SchemaResolveError";
|
|
32
|
+
ErrorCode[ErrorCode["SchemaUnsupportedFeature"] = 769] = "SchemaUnsupportedFeature";
|
|
33
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
34
|
+
export var SchemaDraft;
|
|
35
|
+
(function (SchemaDraft) {
|
|
36
|
+
SchemaDraft[SchemaDraft["v3"] = 3] = "v3";
|
|
37
|
+
SchemaDraft[SchemaDraft["v4"] = 4] = "v4";
|
|
38
|
+
SchemaDraft[SchemaDraft["v6"] = 6] = "v6";
|
|
39
|
+
SchemaDraft[SchemaDraft["v7"] = 7] = "v7";
|
|
40
|
+
SchemaDraft[SchemaDraft["v2019_09"] = 19] = "v2019_09";
|
|
41
|
+
SchemaDraft[SchemaDraft["v2020_12"] = 20] = "v2020_12";
|
|
42
|
+
})(SchemaDraft || (SchemaDraft = {}));
|
|
43
|
+
export var ClientCapabilities;
|
|
44
|
+
(function (ClientCapabilities) {
|
|
45
|
+
ClientCapabilities.LATEST = {
|
|
46
|
+
textDocument: {
|
|
47
|
+
completion: {
|
|
48
|
+
completionItem: {
|
|
49
|
+
documentationFormat: [MarkupKind.Markdown, MarkupKind.PlainText],
|
|
50
|
+
commitCharactersSupport: true
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
})(ClientCapabilities || (ClientCapabilities = {}));
|
package/lib/esm/jsonSchema.d.ts
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
export declare type JSONSchemaRef = JSONSchema | boolean;
|
|
2
|
-
export interface JSONSchema {
|
|
3
|
-
id?: string;
|
|
4
|
-
$id?: string;
|
|
5
|
-
$schema?: string;
|
|
6
|
-
type?: string | string[];
|
|
7
|
-
title?: string;
|
|
8
|
-
default?: any;
|
|
9
|
-
definitions?: {
|
|
10
|
-
[name: string]: JSONSchema;
|
|
11
|
-
};
|
|
12
|
-
description?: string;
|
|
13
|
-
properties?: JSONSchemaMap;
|
|
14
|
-
patternProperties?: JSONSchemaMap;
|
|
15
|
-
additionalProperties?: JSONSchemaRef;
|
|
16
|
-
minProperties?: number;
|
|
17
|
-
maxProperties?: number;
|
|
18
|
-
dependencies?: JSONSchemaMap | {
|
|
19
|
-
[prop: string]: string[];
|
|
20
|
-
};
|
|
21
|
-
items?: JSONSchemaRef | JSONSchemaRef[];
|
|
22
|
-
minItems?: number;
|
|
23
|
-
maxItems?: number;
|
|
24
|
-
uniqueItems?: boolean;
|
|
25
|
-
additionalItems?: JSONSchemaRef;
|
|
26
|
-
pattern?: string;
|
|
27
|
-
minLength?: number;
|
|
28
|
-
maxLength?: number;
|
|
29
|
-
minimum?: number;
|
|
30
|
-
maximum?: number;
|
|
31
|
-
exclusiveMinimum?: boolean | number;
|
|
32
|
-
exclusiveMaximum?: boolean | number;
|
|
33
|
-
multipleOf?: number;
|
|
34
|
-
required?: string[];
|
|
35
|
-
$ref?: string;
|
|
36
|
-
anyOf?: JSONSchemaRef[];
|
|
37
|
-
allOf?: JSONSchemaRef[];
|
|
38
|
-
oneOf?: JSONSchemaRef[];
|
|
39
|
-
not?: JSONSchemaRef;
|
|
40
|
-
enum?: any[];
|
|
41
|
-
format?: string;
|
|
42
|
-
const?: any;
|
|
43
|
-
contains?: JSONSchemaRef;
|
|
44
|
-
propertyNames?: JSONSchemaRef;
|
|
45
|
-
examples?: any[];
|
|
46
|
-
$comment?: string;
|
|
47
|
-
if?: JSONSchemaRef;
|
|
48
|
-
then?: JSONSchemaRef;
|
|
49
|
-
else?: JSONSchemaRef;
|
|
50
|
-
unevaluatedProperties?: boolean | JSONSchemaRef;
|
|
51
|
-
unevaluatedItems?: boolean | JSONSchemaRef;
|
|
52
|
-
minContains?: number;
|
|
53
|
-
maxContains?: number;
|
|
54
|
-
deprecated?: boolean;
|
|
55
|
-
dependentRequired?: {
|
|
56
|
-
[prop: string]: string[];
|
|
57
|
-
};
|
|
58
|
-
dependentSchemas?: JSONSchemaMap;
|
|
59
|
-
$defs?: {
|
|
60
|
-
[name: string]: JSONSchema;
|
|
61
|
-
};
|
|
62
|
-
$anchor?: string;
|
|
63
|
-
$recursiveRef?: string;
|
|
64
|
-
$recursiveAnchor?: string;
|
|
65
|
-
$vocabulary?: any;
|
|
66
|
-
prefixItems?: JSONSchemaRef[];
|
|
67
|
-
$dynamicRef?: string;
|
|
68
|
-
$dynamicAnchor?: string;
|
|
69
|
-
defaultSnippets?: {
|
|
70
|
-
label?: string;
|
|
71
|
-
description?: string;
|
|
72
|
-
markdownDescription?: string;
|
|
73
|
-
body?: any;
|
|
74
|
-
bodyText?: string;
|
|
75
|
-
}[];
|
|
76
|
-
errorMessage?: string;
|
|
77
|
-
patternErrorMessage?: string;
|
|
78
|
-
deprecationMessage?: string;
|
|
79
|
-
enumDescriptions?: string[];
|
|
80
|
-
markdownEnumDescriptions?: string[];
|
|
81
|
-
markdownDescription?: string;
|
|
82
|
-
doNotSuggest?: boolean;
|
|
83
|
-
suggestSortText?: string;
|
|
84
|
-
allowComments?: boolean;
|
|
85
|
-
allowTrailingCommas?: boolean;
|
|
86
|
-
}
|
|
87
|
-
export interface JSONSchemaMap {
|
|
88
|
-
[name: string]: JSONSchemaRef;
|
|
89
|
-
}
|
|
1
|
+
export declare type JSONSchemaRef = JSONSchema | boolean;
|
|
2
|
+
export interface JSONSchema {
|
|
3
|
+
id?: string;
|
|
4
|
+
$id?: string;
|
|
5
|
+
$schema?: string;
|
|
6
|
+
type?: string | string[];
|
|
7
|
+
title?: string;
|
|
8
|
+
default?: any;
|
|
9
|
+
definitions?: {
|
|
10
|
+
[name: string]: JSONSchema;
|
|
11
|
+
};
|
|
12
|
+
description?: string;
|
|
13
|
+
properties?: JSONSchemaMap;
|
|
14
|
+
patternProperties?: JSONSchemaMap;
|
|
15
|
+
additionalProperties?: JSONSchemaRef;
|
|
16
|
+
minProperties?: number;
|
|
17
|
+
maxProperties?: number;
|
|
18
|
+
dependencies?: JSONSchemaMap | {
|
|
19
|
+
[prop: string]: string[];
|
|
20
|
+
};
|
|
21
|
+
items?: JSONSchemaRef | JSONSchemaRef[];
|
|
22
|
+
minItems?: number;
|
|
23
|
+
maxItems?: number;
|
|
24
|
+
uniqueItems?: boolean;
|
|
25
|
+
additionalItems?: JSONSchemaRef;
|
|
26
|
+
pattern?: string;
|
|
27
|
+
minLength?: number;
|
|
28
|
+
maxLength?: number;
|
|
29
|
+
minimum?: number;
|
|
30
|
+
maximum?: number;
|
|
31
|
+
exclusiveMinimum?: boolean | number;
|
|
32
|
+
exclusiveMaximum?: boolean | number;
|
|
33
|
+
multipleOf?: number;
|
|
34
|
+
required?: string[];
|
|
35
|
+
$ref?: string;
|
|
36
|
+
anyOf?: JSONSchemaRef[];
|
|
37
|
+
allOf?: JSONSchemaRef[];
|
|
38
|
+
oneOf?: JSONSchemaRef[];
|
|
39
|
+
not?: JSONSchemaRef;
|
|
40
|
+
enum?: any[];
|
|
41
|
+
format?: string;
|
|
42
|
+
const?: any;
|
|
43
|
+
contains?: JSONSchemaRef;
|
|
44
|
+
propertyNames?: JSONSchemaRef;
|
|
45
|
+
examples?: any[];
|
|
46
|
+
$comment?: string;
|
|
47
|
+
if?: JSONSchemaRef;
|
|
48
|
+
then?: JSONSchemaRef;
|
|
49
|
+
else?: JSONSchemaRef;
|
|
50
|
+
unevaluatedProperties?: boolean | JSONSchemaRef;
|
|
51
|
+
unevaluatedItems?: boolean | JSONSchemaRef;
|
|
52
|
+
minContains?: number;
|
|
53
|
+
maxContains?: number;
|
|
54
|
+
deprecated?: boolean;
|
|
55
|
+
dependentRequired?: {
|
|
56
|
+
[prop: string]: string[];
|
|
57
|
+
};
|
|
58
|
+
dependentSchemas?: JSONSchemaMap;
|
|
59
|
+
$defs?: {
|
|
60
|
+
[name: string]: JSONSchema;
|
|
61
|
+
};
|
|
62
|
+
$anchor?: string;
|
|
63
|
+
$recursiveRef?: string;
|
|
64
|
+
$recursiveAnchor?: string;
|
|
65
|
+
$vocabulary?: any;
|
|
66
|
+
prefixItems?: JSONSchemaRef[];
|
|
67
|
+
$dynamicRef?: string;
|
|
68
|
+
$dynamicAnchor?: string;
|
|
69
|
+
defaultSnippets?: {
|
|
70
|
+
label?: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
markdownDescription?: string;
|
|
73
|
+
body?: any;
|
|
74
|
+
bodyText?: string;
|
|
75
|
+
}[];
|
|
76
|
+
errorMessage?: string;
|
|
77
|
+
patternErrorMessage?: string;
|
|
78
|
+
deprecationMessage?: string;
|
|
79
|
+
enumDescriptions?: string[];
|
|
80
|
+
markdownEnumDescriptions?: string[];
|
|
81
|
+
markdownDescription?: string;
|
|
82
|
+
doNotSuggest?: boolean;
|
|
83
|
+
suggestSortText?: string;
|
|
84
|
+
allowComments?: boolean;
|
|
85
|
+
allowTrailingCommas?: boolean;
|
|
86
|
+
}
|
|
87
|
+
export interface JSONSchemaMap {
|
|
88
|
+
[name: string]: JSONSchemaRef;
|
|
89
|
+
}
|
package/lib/esm/jsonSchema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|