vscode-json-languageservice 4.1.8

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 (50) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/LICENSE.md +47 -0
  3. package/README.md +65 -0
  4. package/lib/esm/jsonContributions.d.ts +17 -0
  5. package/lib/esm/jsonContributions.js +1 -0
  6. package/lib/esm/jsonLanguageService.d.ts +28 -0
  7. package/lib/esm/jsonLanguageService.js +65 -0
  8. package/lib/esm/jsonLanguageTypes.d.ts +275 -0
  9. package/lib/esm/jsonLanguageTypes.js +45 -0
  10. package/lib/esm/jsonSchema.d.ts +70 -0
  11. package/lib/esm/jsonSchema.js +1 -0
  12. package/lib/esm/parser/jsonParser.js +1212 -0
  13. package/lib/esm/services/configuration.js +528 -0
  14. package/lib/esm/services/jsonCompletion.js +934 -0
  15. package/lib/esm/services/jsonDocumentSymbols.js +278 -0
  16. package/lib/esm/services/jsonFolding.js +121 -0
  17. package/lib/esm/services/jsonHover.js +112 -0
  18. package/lib/esm/services/jsonLinks.js +73 -0
  19. package/lib/esm/services/jsonSchemaService.js +535 -0
  20. package/lib/esm/services/jsonSelectionRanges.js +61 -0
  21. package/lib/esm/services/jsonValidation.js +146 -0
  22. package/lib/esm/utils/colors.js +69 -0
  23. package/lib/esm/utils/glob.js +124 -0
  24. package/lib/esm/utils/json.js +42 -0
  25. package/lib/esm/utils/objects.js +65 -0
  26. package/lib/esm/utils/strings.js +52 -0
  27. package/lib/umd/jsonContributions.d.ts +17 -0
  28. package/lib/umd/jsonContributions.js +12 -0
  29. package/lib/umd/jsonLanguageService.d.ts +28 -0
  30. package/lib/umd/jsonLanguageService.js +89 -0
  31. package/lib/umd/jsonLanguageTypes.d.ts +275 -0
  32. package/lib/umd/jsonLanguageTypes.js +92 -0
  33. package/lib/umd/jsonSchema.d.ts +70 -0
  34. package/lib/umd/jsonSchema.js +12 -0
  35. package/lib/umd/parser/jsonParser.js +1231 -0
  36. package/lib/umd/services/configuration.js +541 -0
  37. package/lib/umd/services/jsonCompletion.js +947 -0
  38. package/lib/umd/services/jsonDocumentSymbols.js +291 -0
  39. package/lib/umd/services/jsonFolding.js +135 -0
  40. package/lib/umd/services/jsonHover.js +125 -0
  41. package/lib/umd/services/jsonLinks.js +87 -0
  42. package/lib/umd/services/jsonSchemaService.js +548 -0
  43. package/lib/umd/services/jsonSelectionRanges.js +75 -0
  44. package/lib/umd/services/jsonValidation.js +159 -0
  45. package/lib/umd/utils/colors.js +85 -0
  46. package/lib/umd/utils/glob.js +138 -0
  47. package/lib/umd/utils/json.js +56 -0
  48. package/lib/umd/utils/objects.js +83 -0
  49. package/lib/umd/utils/strings.js +70 -0
  50. package/package.json +55 -0
@@ -0,0 +1,275 @@
1
+ import { JSONWorkerContribution, JSONPath, Segment, CompletionsCollector } from './jsonContributions';
2
+ import { JSONSchema } from './jsonSchema';
3
+ 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, FormattingOptions as LSPFormattingOptions, DefinitionLink, CodeActionContext, Command, CodeAction, DocumentHighlight, DocumentLink, WorkspaceEdit, TextEdit, CodeActionKind, TextDocumentEdit, VersionedTextDocumentIdentifier, DocumentHighlightKind } from 'vscode-languageserver-types';
4
+ import { TextDocument } from 'vscode-languageserver-textdocument';
5
+ export { TextDocument, Range, Position, DocumentUri, MarkupContent, MarkupKind, JSONSchema, JSONWorkerContribution, JSONPath, Segment, CompletionsCollector, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, CompletionItemTag, InsertTextFormat, DefinitionLink, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, CodeActionContext, Command, CodeAction, DocumentHighlight, DocumentLink, WorkspaceEdit, TextEdit, CodeActionKind, TextDocumentEdit, VersionedTextDocumentIdentifier, DocumentHighlightKind };
6
+ /**
7
+ * Error codes used by diagnostics
8
+ */
9
+ export declare enum ErrorCode {
10
+ Undefined = 0,
11
+ EnumValueMismatch = 1,
12
+ Deprecated = 2,
13
+ UnexpectedEndOfComment = 257,
14
+ UnexpectedEndOfString = 258,
15
+ UnexpectedEndOfNumber = 259,
16
+ InvalidUnicode = 260,
17
+ InvalidEscapeCharacter = 261,
18
+ InvalidCharacter = 262,
19
+ PropertyExpected = 513,
20
+ CommaExpected = 514,
21
+ ColonExpected = 515,
22
+ ValueExpected = 516,
23
+ CommaOrCloseBacketExpected = 517,
24
+ CommaOrCloseBraceExpected = 518,
25
+ TrailingComma = 519,
26
+ DuplicateKey = 520,
27
+ CommentNotPermitted = 521,
28
+ SchemaResolveError = 768
29
+ }
30
+ export declare type ASTNode = ObjectASTNode | PropertyASTNode | ArrayASTNode | StringASTNode | NumberASTNode | BooleanASTNode | NullASTNode;
31
+ export interface BaseASTNode {
32
+ readonly type: 'object' | 'array' | 'property' | 'string' | 'number' | 'boolean' | 'null';
33
+ readonly parent?: ASTNode;
34
+ readonly offset: number;
35
+ readonly length: number;
36
+ readonly children?: ASTNode[];
37
+ readonly value?: string | boolean | number | null;
38
+ }
39
+ export interface ObjectASTNode extends BaseASTNode {
40
+ readonly type: 'object';
41
+ readonly properties: PropertyASTNode[];
42
+ readonly children: ASTNode[];
43
+ }
44
+ export interface PropertyASTNode extends BaseASTNode {
45
+ readonly type: 'property';
46
+ readonly keyNode: StringASTNode;
47
+ readonly valueNode?: ASTNode;
48
+ readonly colonOffset?: number;
49
+ readonly children: ASTNode[];
50
+ }
51
+ export interface ArrayASTNode extends BaseASTNode {
52
+ readonly type: 'array';
53
+ readonly items: ASTNode[];
54
+ readonly children: ASTNode[];
55
+ }
56
+ export interface StringASTNode extends BaseASTNode {
57
+ readonly type: 'string';
58
+ readonly value: string;
59
+ }
60
+ export interface NumberASTNode extends BaseASTNode {
61
+ readonly type: 'number';
62
+ readonly value: number;
63
+ readonly isInteger: boolean;
64
+ }
65
+ export interface BooleanASTNode extends BaseASTNode {
66
+ readonly type: 'boolean';
67
+ readonly value: boolean;
68
+ }
69
+ export interface NullASTNode extends BaseASTNode {
70
+ readonly type: 'null';
71
+ readonly value: null;
72
+ }
73
+ export interface MatchingSchema {
74
+ node: ASTNode;
75
+ schema: JSONSchema;
76
+ }
77
+ export interface LanguageSettings {
78
+ /**
79
+ * If set, the validator will return syntax and semantic errors.
80
+ */
81
+ validate?: boolean;
82
+ /**
83
+ * Defines whether comments are allowed or not. If set to false, comments will be reported as errors.
84
+ * DocumentLanguageSettings.allowComments will override this setting.
85
+ */
86
+ allowComments?: boolean;
87
+ /**
88
+ * A list of known schemas and/or associations of schemas to file names.
89
+ */
90
+ schemas?: SchemaConfiguration[];
91
+ }
92
+ export declare type SeverityLevel = 'error' | 'warning' | 'ignore';
93
+ export interface DocumentLanguageSettings {
94
+ /**
95
+ * The severity of reported comments. If not set, 'LanguageSettings.allowComments' defines whether comments are ignored or reported as errors.
96
+ */
97
+ comments?: SeverityLevel;
98
+ /**
99
+ * The severity of reported trailing commas. If not set, trailing commas will be reported as errors.
100
+ */
101
+ trailingCommas?: SeverityLevel;
102
+ /**
103
+ * The severity of problems from schema validation. If set to 'ignore', schema validation will be skipped. If not set, 'warning' is used.
104
+ */
105
+ schemaValidation?: SeverityLevel;
106
+ /**
107
+ * The severity of problems that occurred when resolving and loading schemas. If set to 'ignore', schema resolving problems are not reported. If not set, 'warning' is used.
108
+ */
109
+ schemaRequest?: SeverityLevel;
110
+ }
111
+ export interface SchemaConfiguration {
112
+ /**
113
+ * The URI of the schema, which is also the identifier of the schema.
114
+ */
115
+ uri: string;
116
+ /**
117
+ * A list of glob patterns that describe for which file URIs the JSON schema will be used.
118
+ * '*' and '**' wildcards are supported. Exclusion patterns start with '!'.
119
+ * For example '*.schema.json', 'package.json', '!foo*.schema.json', 'foo/**\/BADRESP.json'.
120
+ * A match succeeds when there is at least one pattern matching and last matching pattern does not start with '!'.
121
+ */
122
+ fileMatch?: string[];
123
+ /**
124
+ * The schema for the given URI.
125
+ * If no schema is provided, the schema will be fetched with the schema request service (if available).
126
+ */
127
+ schema?: JSONSchema;
128
+ }
129
+ export interface WorkspaceContextService {
130
+ resolveRelativePath(relativePath: string, resource: string): string;
131
+ }
132
+ /**
133
+ * The schema request service is used to fetch schemas. If successful, returns a resolved promise with the content of the schema.
134
+ * In case of an error, returns a rejected promise with a displayable error string.
135
+ */
136
+ export interface SchemaRequestService {
137
+ (uri: string): Thenable<string>;
138
+ }
139
+ export interface PromiseConstructor {
140
+ /**
141
+ * Creates a new Promise.
142
+ * @param executor A callback used to initialize the promise. This callback is passed two arguments:
143
+ * a resolve callback used resolve the promise with a value or the result of another promise,
144
+ * and a reject callback used to reject the promise with a provided reason or error.
145
+ */
146
+ new <T>(executor: (resolve: (value?: T | Thenable<T | undefined>) => void, reject: (reason?: any) => void) => void): Thenable<T | undefined>;
147
+ /**
148
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
149
+ * resolve, or rejected when any Promise is rejected.
150
+ * @param values An array of Promises.
151
+ * @returns A new Promise.
152
+ */
153
+ all<T>(values: Array<T | Thenable<T>>): Thenable<T[]>;
154
+ /**
155
+ * Creates a new rejected promise for the provided reason.
156
+ * @param reason The reason the promise was rejected.
157
+ * @returns A new rejected Promise.
158
+ */
159
+ reject<T>(reason: any): Thenable<T>;
160
+ /**
161
+ * Creates a new resolved promise for the provided value.
162
+ * @param value A promise.
163
+ * @returns A promise whose internal state matches the provided promise.
164
+ */
165
+ resolve<T>(value: T | Thenable<T>): Thenable<T>;
166
+ }
167
+ export interface Thenable<R> {
168
+ /**
169
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
170
+ * @param onfulfilled The callback to execute when the Promise is resolved.
171
+ * @param onrejected The callback to execute when the Promise is rejected.
172
+ * @returns A Promise for the completion of which ever callback is executed.
173
+ */
174
+ then<TResult>(onfulfilled?: (value: R) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
175
+ then<TResult>(onfulfilled?: (value: R) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
176
+ }
177
+ export interface LanguageServiceParams {
178
+ /**
179
+ * The schema request service is used to fetch schemas from a URI. The provider returns the schema file content, or,
180
+ * in case of an error, a displayable error string
181
+ */
182
+ schemaRequestService?: SchemaRequestService;
183
+ /**
184
+ * The workspace context is used to resolve relative paths for relative schema references.
185
+ */
186
+ workspaceContext?: WorkspaceContextService;
187
+ /**
188
+ * An optional set of completion and hover participants.
189
+ */
190
+ contributions?: JSONWorkerContribution[];
191
+ /**
192
+ * A promise constructor. If not set, the ES5 Promise will be used.
193
+ */
194
+ promiseConstructor?: PromiseConstructor;
195
+ /**
196
+ * Describes the LSP capabilities the client supports.
197
+ */
198
+ clientCapabilities?: ClientCapabilities;
199
+ }
200
+ /**
201
+ * Describes what LSP capabilities the client supports
202
+ */
203
+ export interface ClientCapabilities {
204
+ /**
205
+ * The text document client capabilities
206
+ */
207
+ textDocument?: {
208
+ /**
209
+ * Capabilities specific to completions.
210
+ */
211
+ completion?: {
212
+ /**
213
+ * The client supports the following `CompletionItem` specific
214
+ * capabilities.
215
+ */
216
+ completionItem?: {
217
+ /**
218
+ * Client supports the follow content formats for the documentation
219
+ * property. The order describes the preferred format of the client.
220
+ */
221
+ documentationFormat?: MarkupKind[];
222
+ /**
223
+ * The client supports commit characters on a completion item.
224
+ */
225
+ commitCharactersSupport?: boolean;
226
+ };
227
+ };
228
+ /**
229
+ * Capabilities specific to hovers.
230
+ */
231
+ hover?: {
232
+ /**
233
+ * Client supports the follow content formats for the content
234
+ * property. The order describes the preferred format of the client.
235
+ */
236
+ contentFormat?: MarkupKind[];
237
+ };
238
+ };
239
+ }
240
+ export declare namespace ClientCapabilities {
241
+ const LATEST: ClientCapabilities;
242
+ }
243
+ export interface FoldingRangesContext {
244
+ /**
245
+ * The maximal number of ranges returned.
246
+ */
247
+ rangeLimit?: number;
248
+ /**
249
+ * Called when the result was cropped.
250
+ */
251
+ onRangeLimitExceeded?: (uri: string) => void;
252
+ }
253
+ export interface DocumentSymbolsContext {
254
+ /**
255
+ * The maximal number of document symbols returned.
256
+ */
257
+ resultLimit?: number;
258
+ /**
259
+ * Called when the result was cropped.
260
+ */
261
+ onResultLimitExceeded?: (uri: string) => void;
262
+ }
263
+ export interface ColorInformationContext {
264
+ /**
265
+ * The maximal number of color informations returned.
266
+ */
267
+ resultLimit?: number;
268
+ /**
269
+ * Called when the result was cropped.
270
+ */
271
+ onResultLimitExceeded?: (uri: string) => void;
272
+ }
273
+ export interface FormattingOptions extends LSPFormattingOptions {
274
+ insertFinalNewline?: boolean;
275
+ }
@@ -0,0 +1,92 @@
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
+ (function (factory) {
6
+ if (typeof module === "object" && typeof module.exports === "object") {
7
+ var v = factory(require, exports);
8
+ if (v !== undefined) module.exports = v;
9
+ }
10
+ else if (typeof define === "function" && define.amd) {
11
+ define(["require", "exports", "vscode-languageserver-types", "vscode-languageserver-textdocument"], factory);
12
+ }
13
+ })(function (require, exports) {
14
+ "use strict";
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ClientCapabilities = exports.ErrorCode = exports.DocumentHighlightKind = exports.VersionedTextDocumentIdentifier = exports.TextDocumentEdit = exports.CodeActionKind = exports.TextEdit = exports.WorkspaceEdit = exports.DocumentLink = exports.DocumentHighlight = exports.CodeAction = exports.Command = exports.CodeActionContext = exports.MarkedString = exports.Hover = exports.Location = exports.DocumentSymbol = exports.SymbolKind = exports.SymbolInformation = exports.InsertTextFormat = exports.CompletionItemTag = exports.CompletionList = exports.CompletionItemKind = exports.CompletionItem = exports.DiagnosticSeverity = exports.Diagnostic = exports.SelectionRange = exports.FoldingRangeKind = exports.FoldingRange = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.MarkupKind = exports.MarkupContent = exports.Position = exports.Range = exports.TextDocument = void 0;
17
+ var vscode_languageserver_types_1 = require("vscode-languageserver-types");
18
+ Object.defineProperty(exports, "Range", { enumerable: true, get: function () { return vscode_languageserver_types_1.Range; } });
19
+ Object.defineProperty(exports, "Position", { enumerable: true, get: function () { return vscode_languageserver_types_1.Position; } });
20
+ Object.defineProperty(exports, "MarkupContent", { enumerable: true, get: function () { return vscode_languageserver_types_1.MarkupContent; } });
21
+ Object.defineProperty(exports, "MarkupKind", { enumerable: true, get: function () { return vscode_languageserver_types_1.MarkupKind; } });
22
+ Object.defineProperty(exports, "Color", { enumerable: true, get: function () { return vscode_languageserver_types_1.Color; } });
23
+ Object.defineProperty(exports, "ColorInformation", { enumerable: true, get: function () { return vscode_languageserver_types_1.ColorInformation; } });
24
+ Object.defineProperty(exports, "ColorPresentation", { enumerable: true, get: function () { return vscode_languageserver_types_1.ColorPresentation; } });
25
+ Object.defineProperty(exports, "FoldingRange", { enumerable: true, get: function () { return vscode_languageserver_types_1.FoldingRange; } });
26
+ Object.defineProperty(exports, "FoldingRangeKind", { enumerable: true, get: function () { return vscode_languageserver_types_1.FoldingRangeKind; } });
27
+ Object.defineProperty(exports, "SelectionRange", { enumerable: true, get: function () { return vscode_languageserver_types_1.SelectionRange; } });
28
+ Object.defineProperty(exports, "Diagnostic", { enumerable: true, get: function () { return vscode_languageserver_types_1.Diagnostic; } });
29
+ Object.defineProperty(exports, "DiagnosticSeverity", { enumerable: true, get: function () { return vscode_languageserver_types_1.DiagnosticSeverity; } });
30
+ Object.defineProperty(exports, "CompletionItem", { enumerable: true, get: function () { return vscode_languageserver_types_1.CompletionItem; } });
31
+ Object.defineProperty(exports, "CompletionItemKind", { enumerable: true, get: function () { return vscode_languageserver_types_1.CompletionItemKind; } });
32
+ Object.defineProperty(exports, "CompletionList", { enumerable: true, get: function () { return vscode_languageserver_types_1.CompletionList; } });
33
+ Object.defineProperty(exports, "CompletionItemTag", { enumerable: true, get: function () { return vscode_languageserver_types_1.CompletionItemTag; } });
34
+ Object.defineProperty(exports, "InsertTextFormat", { enumerable: true, get: function () { return vscode_languageserver_types_1.InsertTextFormat; } });
35
+ Object.defineProperty(exports, "SymbolInformation", { enumerable: true, get: function () { return vscode_languageserver_types_1.SymbolInformation; } });
36
+ Object.defineProperty(exports, "SymbolKind", { enumerable: true, get: function () { return vscode_languageserver_types_1.SymbolKind; } });
37
+ Object.defineProperty(exports, "DocumentSymbol", { enumerable: true, get: function () { return vscode_languageserver_types_1.DocumentSymbol; } });
38
+ Object.defineProperty(exports, "Location", { enumerable: true, get: function () { return vscode_languageserver_types_1.Location; } });
39
+ Object.defineProperty(exports, "Hover", { enumerable: true, get: function () { return vscode_languageserver_types_1.Hover; } });
40
+ Object.defineProperty(exports, "MarkedString", { enumerable: true, get: function () { return vscode_languageserver_types_1.MarkedString; } });
41
+ Object.defineProperty(exports, "CodeActionContext", { enumerable: true, get: function () { return vscode_languageserver_types_1.CodeActionContext; } });
42
+ Object.defineProperty(exports, "Command", { enumerable: true, get: function () { return vscode_languageserver_types_1.Command; } });
43
+ Object.defineProperty(exports, "CodeAction", { enumerable: true, get: function () { return vscode_languageserver_types_1.CodeAction; } });
44
+ Object.defineProperty(exports, "DocumentHighlight", { enumerable: true, get: function () { return vscode_languageserver_types_1.DocumentHighlight; } });
45
+ Object.defineProperty(exports, "DocumentLink", { enumerable: true, get: function () { return vscode_languageserver_types_1.DocumentLink; } });
46
+ Object.defineProperty(exports, "WorkspaceEdit", { enumerable: true, get: function () { return vscode_languageserver_types_1.WorkspaceEdit; } });
47
+ Object.defineProperty(exports, "TextEdit", { enumerable: true, get: function () { return vscode_languageserver_types_1.TextEdit; } });
48
+ Object.defineProperty(exports, "CodeActionKind", { enumerable: true, get: function () { return vscode_languageserver_types_1.CodeActionKind; } });
49
+ Object.defineProperty(exports, "TextDocumentEdit", { enumerable: true, get: function () { return vscode_languageserver_types_1.TextDocumentEdit; } });
50
+ Object.defineProperty(exports, "VersionedTextDocumentIdentifier", { enumerable: true, get: function () { return vscode_languageserver_types_1.VersionedTextDocumentIdentifier; } });
51
+ Object.defineProperty(exports, "DocumentHighlightKind", { enumerable: true, get: function () { return vscode_languageserver_types_1.DocumentHighlightKind; } });
52
+ var vscode_languageserver_textdocument_1 = require("vscode-languageserver-textdocument");
53
+ Object.defineProperty(exports, "TextDocument", { enumerable: true, get: function () { return vscode_languageserver_textdocument_1.TextDocument; } });
54
+ /**
55
+ * Error codes used by diagnostics
56
+ */
57
+ var ErrorCode;
58
+ (function (ErrorCode) {
59
+ ErrorCode[ErrorCode["Undefined"] = 0] = "Undefined";
60
+ ErrorCode[ErrorCode["EnumValueMismatch"] = 1] = "EnumValueMismatch";
61
+ ErrorCode[ErrorCode["Deprecated"] = 2] = "Deprecated";
62
+ ErrorCode[ErrorCode["UnexpectedEndOfComment"] = 257] = "UnexpectedEndOfComment";
63
+ ErrorCode[ErrorCode["UnexpectedEndOfString"] = 258] = "UnexpectedEndOfString";
64
+ ErrorCode[ErrorCode["UnexpectedEndOfNumber"] = 259] = "UnexpectedEndOfNumber";
65
+ ErrorCode[ErrorCode["InvalidUnicode"] = 260] = "InvalidUnicode";
66
+ ErrorCode[ErrorCode["InvalidEscapeCharacter"] = 261] = "InvalidEscapeCharacter";
67
+ ErrorCode[ErrorCode["InvalidCharacter"] = 262] = "InvalidCharacter";
68
+ ErrorCode[ErrorCode["PropertyExpected"] = 513] = "PropertyExpected";
69
+ ErrorCode[ErrorCode["CommaExpected"] = 514] = "CommaExpected";
70
+ ErrorCode[ErrorCode["ColonExpected"] = 515] = "ColonExpected";
71
+ ErrorCode[ErrorCode["ValueExpected"] = 516] = "ValueExpected";
72
+ ErrorCode[ErrorCode["CommaOrCloseBacketExpected"] = 517] = "CommaOrCloseBacketExpected";
73
+ ErrorCode[ErrorCode["CommaOrCloseBraceExpected"] = 518] = "CommaOrCloseBraceExpected";
74
+ ErrorCode[ErrorCode["TrailingComma"] = 519] = "TrailingComma";
75
+ ErrorCode[ErrorCode["DuplicateKey"] = 520] = "DuplicateKey";
76
+ ErrorCode[ErrorCode["CommentNotPermitted"] = 521] = "CommentNotPermitted";
77
+ ErrorCode[ErrorCode["SchemaResolveError"] = 768] = "SchemaResolveError";
78
+ })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
79
+ var ClientCapabilities;
80
+ (function (ClientCapabilities) {
81
+ ClientCapabilities.LATEST = {
82
+ textDocument: {
83
+ completion: {
84
+ completionItem: {
85
+ documentationFormat: [vscode_languageserver_types_1.MarkupKind.Markdown, vscode_languageserver_types_1.MarkupKind.PlainText],
86
+ commitCharactersSupport: true
87
+ }
88
+ }
89
+ }
90
+ };
91
+ })(ClientCapabilities = exports.ClientCapabilities || (exports.ClientCapabilities = {}));
92
+ });
@@ -0,0 +1,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?: boolean | 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?: boolean | 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
+ defaultSnippets?: {
51
+ label?: string;
52
+ description?: string;
53
+ markdownDescription?: string;
54
+ body?: any;
55
+ bodyText?: string;
56
+ }[];
57
+ errorMessage?: string;
58
+ patternErrorMessage?: string;
59
+ deprecationMessage?: string;
60
+ enumDescriptions?: string[];
61
+ markdownEnumDescriptions?: string[];
62
+ markdownDescription?: string;
63
+ doNotSuggest?: boolean;
64
+ suggestSortText?: string;
65
+ allowComments?: boolean;
66
+ allowTrailingCommas?: boolean;
67
+ }
68
+ export interface JSONSchemaMap {
69
+ [name: string]: JSONSchemaRef;
70
+ }
@@ -0,0 +1,12 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ });