vscode-json-languageservice 4.2.0-next.3 → 5.0.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 +7 -1
- package/SECURITY.md +41 -0
- 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 +279 -278
- package/lib/esm/jsonLanguageTypes.js +46 -45
- package/lib/esm/jsonSchema.d.ts +89 -70
- package/lib/esm/jsonSchema.js +1 -1
- package/lib/esm/parser/jsonParser.js +1214 -1218
- package/lib/esm/services/configuration.js +528 -528
- package/lib/esm/services/jsonCompletion.js +918 -934
- package/lib/esm/services/jsonDocumentSymbols.js +267 -278
- package/lib/esm/services/jsonFolding.js +120 -121
- package/lib/esm/services/jsonHover.js +109 -112
- package/lib/esm/services/jsonLinks.js +72 -73
- package/lib/esm/services/jsonSchemaService.js +586 -605
- package/lib/esm/services/jsonSelectionRanges.js +61 -61
- package/lib/esm/services/jsonValidation.js +151 -149
- package/lib/esm/utils/colors.js +68 -69
- package/lib/esm/utils/glob.js +124 -124
- package/lib/esm/utils/json.js +42 -42
- package/lib/esm/utils/objects.js +68 -65
- package/lib/esm/utils/strings.js +64 -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 +90 -90
- package/lib/umd/jsonLanguageTypes.d.ts +279 -278
- package/lib/umd/jsonLanguageTypes.js +93 -92
- package/lib/umd/jsonSchema.d.ts +89 -70
- package/lib/umd/jsonSchema.js +12 -12
- package/lib/umd/parser/jsonParser.js +1243 -1237
- package/lib/umd/services/configuration.js +541 -541
- package/lib/umd/services/jsonCompletion.js +932 -947
- package/lib/umd/services/jsonDocumentSymbols.js +281 -291
- package/lib/umd/services/jsonFolding.js +134 -135
- package/lib/umd/services/jsonHover.js +123 -125
- package/lib/umd/services/jsonLinks.js +86 -87
- package/lib/umd/services/jsonSchemaService.js +602 -618
- package/lib/umd/services/jsonSelectionRanges.js +75 -75
- package/lib/umd/services/jsonValidation.js +165 -162
- package/lib/umd/utils/colors.js +84 -85
- package/lib/umd/utils/glob.js +138 -138
- package/lib/umd/utils/json.js +56 -56
- package/lib/umd/utils/objects.js +87 -83
- package/lib/umd/utils/strings.js +82 -82
- package/package.json +10 -10
|
@@ -1,45 +1,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, 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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
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 ClientCapabilities;
|
|
35
|
+
(function (ClientCapabilities) {
|
|
36
|
+
ClientCapabilities.LATEST = {
|
|
37
|
+
textDocument: {
|
|
38
|
+
completion: {
|
|
39
|
+
completionItem: {
|
|
40
|
+
documentationFormat: [MarkupKind.Markdown, MarkupKind.PlainText],
|
|
41
|
+
commitCharactersSupport: true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
})(ClientCapabilities || (ClientCapabilities = {}));
|
package/lib/esm/jsonSchema.d.ts
CHANGED
|
@@ -1,70 +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?:
|
|
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?:
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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 {};
|