@codingame/monaco-languageclient-wrapper 5.0.0-next.0 → 5.0.0-update-monaco.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.
Files changed (119) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +29 -0
  2. package/dist/_virtual/_rollupPluginBabelHelpers.js +50 -0
  3. package/dist/_virtual/api.js +2 -0
  4. package/dist/_virtual/api2.js +2 -0
  5. package/dist/_virtual/cancellation.js +2 -0
  6. package/dist/_virtual/connection.js +2 -0
  7. package/dist/_virtual/connection2.js +2 -0
  8. package/dist/_virtual/disposable.js +2 -0
  9. package/dist/_virtual/events.js +2 -0
  10. package/dist/_virtual/is.js +2 -0
  11. package/dist/_virtual/is2.js +2 -0
  12. package/dist/_virtual/linkedMap.js +2 -0
  13. package/dist/_virtual/main.js +2 -0
  14. package/dist/_virtual/main2.js +2 -0
  15. package/dist/_virtual/main3.js +4 -0
  16. package/dist/_virtual/messageBuffer.js +2 -0
  17. package/dist/_virtual/messageReader.js +2 -0
  18. package/dist/_virtual/messageWriter.js +2 -0
  19. package/dist/_virtual/messages.js +2 -0
  20. package/dist/_virtual/messages2.js +2 -0
  21. package/dist/_virtual/once.js +2 -0
  22. package/dist/_virtual/protocol.callHierarchy.js +2 -0
  23. package/dist/_virtual/protocol.colorProvider.js +2 -0
  24. package/dist/_virtual/protocol.configuration.js +2 -0
  25. package/dist/_virtual/protocol.declaration.js +2 -0
  26. package/dist/_virtual/protocol.diagnostic.js +2 -0
  27. package/dist/_virtual/protocol.fileOperations.js +2 -0
  28. package/dist/_virtual/protocol.foldingRange.js +2 -0
  29. package/dist/_virtual/protocol.implementation.js +2 -0
  30. package/dist/_virtual/protocol.inlayHint.js +2 -0
  31. package/dist/_virtual/protocol.inlineCompletion.js +2 -0
  32. package/dist/_virtual/protocol.inlineValue.js +2 -0
  33. package/dist/_virtual/protocol.js +2 -0
  34. package/dist/_virtual/protocol.linkedEditingRange.js +2 -0
  35. package/dist/_virtual/protocol.moniker.js +2 -0
  36. package/dist/_virtual/protocol.notebook.js +2 -0
  37. package/dist/_virtual/protocol.progress.js +2 -0
  38. package/dist/_virtual/protocol.selectionRange.js +2 -0
  39. package/dist/_virtual/protocol.semanticTokens.js +2 -0
  40. package/dist/_virtual/protocol.showDocument.js +2 -0
  41. package/dist/_virtual/protocol.typeDefinition.js +2 -0
  42. package/dist/_virtual/protocol.typeHierarchy.js +2 -0
  43. package/dist/_virtual/protocol.workspaceFolder.js +2 -0
  44. package/dist/_virtual/ral.js +2 -0
  45. package/dist/_virtual/ril.js +2 -0
  46. package/dist/_virtual/semaphore.js +2 -0
  47. package/dist/_virtual/sharedArrayCancellation.js +2 -0
  48. package/dist/extensions/java/commands.js +74 -0
  49. package/dist/extensions/java/extension.js +13 -0
  50. package/dist/extensions/java/inlayHintsProvider.js +58 -0
  51. package/dist/extensions/java/protocol.js +68 -0
  52. package/dist/{java.js → extensions/java/sourceAction.js} +7 -245
  53. package/dist/index.d.ts +133 -9214
  54. package/dist/index.js +5 -1
  55. package/dist/node_modules/delay/index.js +45 -0
  56. package/dist/node_modules/once/once.js +44 -0
  57. package/dist/node_modules/tslib/tslib.es6.js +14 -0
  58. package/dist/node_modules/vscode-jsonrpc/browser.js +4 -0
  59. package/dist/node_modules/vscode-jsonrpc/lib/browser/main.js +77 -0
  60. package/dist/node_modules/vscode-jsonrpc/lib/browser/ril.js +153 -0
  61. package/dist/node_modules/vscode-jsonrpc/lib/common/api.js +96 -0
  62. package/dist/node_modules/vscode-jsonrpc/lib/common/cancellation.js +95 -0
  63. package/dist/node_modules/vscode-jsonrpc/lib/common/connection.js +1182 -0
  64. package/dist/node_modules/vscode-jsonrpc/lib/common/disposable.js +19 -0
  65. package/dist/node_modules/vscode-jsonrpc/lib/common/events.js +121 -0
  66. package/dist/node_modules/vscode-jsonrpc/lib/common/is.js +38 -0
  67. package/dist/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +386 -0
  68. package/dist/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +149 -0
  69. package/dist/node_modules/vscode-jsonrpc/lib/common/messageReader.js +198 -0
  70. package/dist/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +122 -0
  71. package/dist/node_modules/vscode-jsonrpc/lib/common/messages.js +240 -0
  72. package/dist/node_modules/vscode-jsonrpc/lib/common/ral.js +26 -0
  73. package/dist/node_modules/vscode-jsonrpc/lib/common/semaphore.js +72 -0
  74. package/dist/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +80 -0
  75. package/dist/node_modules/vscode-languageserver-protocol/lib/browser/main.js +30 -0
  76. package/dist/node_modules/vscode-languageserver-protocol/lib/common/api.js +44 -0
  77. package/dist/node_modules/vscode-languageserver-protocol/lib/common/connection.js +14 -0
  78. package/dist/node_modules/vscode-languageserver-protocol/lib/common/messages.js +43 -0
  79. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js +25 -0
  80. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js +19 -0
  81. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js +13 -0
  82. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js +13 -0
  83. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +46 -0
  84. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js +48 -0
  85. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js +19 -0
  86. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js +13 -0
  87. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js +25 -0
  88. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js +13 -0
  89. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js +19 -0
  90. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.js +566 -0
  91. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js +13 -0
  92. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js +27 -0
  93. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js +190 -0
  94. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js +30 -0
  95. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js +13 -0
  96. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js +43 -0
  97. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js +13 -0
  98. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js +13 -0
  99. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js +25 -0
  100. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js +19 -0
  101. package/dist/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js +40 -0
  102. package/dist/node_modules/vscode-languageserver-types/lib/esm/main.js +1608 -0
  103. package/dist/node_modules/wrappy/wrappy.js +25 -0
  104. package/dist/src/createLanguageClient.js +132 -0
  105. package/dist/src/customRequests.js +21 -0
  106. package/dist/src/extensionConfiguration.js +5 -0
  107. package/dist/{cobol.js → src/extensions/cobol.js} +4 -3
  108. package/dist/{csharp.js → src/extensions/csharp.js} +3 -2
  109. package/dist/src/extensions/java.js +36 -0
  110. package/dist/{tools.js → src/extensions/tools.js} +7 -3
  111. package/dist/src/extensions.js +173 -0
  112. package/dist/src/infrastructure.js +83 -0
  113. package/dist/src/languageClient.js +306 -0
  114. package/dist/src/languageClientOptions.js +17 -0
  115. package/dist/src/services.js +8 -0
  116. package/dist/src/staticOptions.js +441 -0
  117. package/package.json +56 -53
  118. package/stats.html +32 -28
  119. package/dist/index2.js +0 -17150
@@ -0,0 +1,1608 @@
1
+ var DocumentUri;
2
+ (function (DocumentUri) {
3
+ function is(value) {
4
+ return typeof value === 'string';
5
+ }
6
+ DocumentUri.is = is;
7
+ })(DocumentUri || (DocumentUri = {}));
8
+ var URI;
9
+ (function (URI) {
10
+ function is(value) {
11
+ return typeof value === 'string';
12
+ }
13
+ URI.is = is;
14
+ })(URI || (URI = {}));
15
+ var integer;
16
+ (function (integer) {
17
+ integer.MIN_VALUE = -2147483648;
18
+ integer.MAX_VALUE = 2147483647;
19
+ function is(value) {
20
+ return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;
21
+ }
22
+ integer.is = is;
23
+ })(integer || (integer = {}));
24
+ var uinteger;
25
+ (function (uinteger) {
26
+ uinteger.MIN_VALUE = 0;
27
+ uinteger.MAX_VALUE = 2147483647;
28
+ function is(value) {
29
+ return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;
30
+ }
31
+ uinteger.is = is;
32
+ })(uinteger || (uinteger = {}));
33
+ var Position;
34
+ (function (Position) {
35
+ function create(line, character) {
36
+ if (line === Number.MAX_VALUE) {
37
+ line = uinteger.MAX_VALUE;
38
+ }
39
+ if (character === Number.MAX_VALUE) {
40
+ character = uinteger.MAX_VALUE;
41
+ }
42
+ return {
43
+ line,
44
+ character
45
+ };
46
+ }
47
+ Position.create = create;
48
+ function is(value) {
49
+ let candidate = value;
50
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
51
+ }
52
+ Position.is = is;
53
+ })(Position || (Position = {}));
54
+ var Range;
55
+ (function (Range) {
56
+ function create(one, two, three, four) {
57
+ if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
58
+ return {
59
+ start: Position.create(one, two),
60
+ end: Position.create(three, four)
61
+ };
62
+ } else if (Position.is(one) && Position.is(two)) {
63
+ return {
64
+ start: one,
65
+ end: two
66
+ };
67
+ } else {
68
+ throw new Error("Range#create called with invalid arguments[".concat(one, ", ").concat(two, ", ").concat(three, ", ").concat(four, "]"));
69
+ }
70
+ }
71
+ Range.create = create;
72
+ function is(value) {
73
+ let candidate = value;
74
+ return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
75
+ }
76
+ Range.is = is;
77
+ })(Range || (Range = {}));
78
+ var Location;
79
+ (function (Location) {
80
+ function create(uri, range) {
81
+ return {
82
+ uri,
83
+ range
84
+ };
85
+ }
86
+ Location.create = create;
87
+ function is(value) {
88
+ let candidate = value;
89
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
90
+ }
91
+ Location.is = is;
92
+ })(Location || (Location = {}));
93
+ var LocationLink;
94
+ (function (LocationLink) {
95
+ function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
96
+ return {
97
+ targetUri,
98
+ targetRange,
99
+ targetSelectionRange,
100
+ originSelectionRange
101
+ };
102
+ }
103
+ LocationLink.create = create;
104
+ function is(value) {
105
+ let candidate = value;
106
+ return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
107
+ }
108
+ LocationLink.is = is;
109
+ })(LocationLink || (LocationLink = {}));
110
+ var Color;
111
+ (function (Color) {
112
+ function create(red, green, blue, alpha) {
113
+ return {
114
+ red,
115
+ green,
116
+ blue,
117
+ alpha
118
+ };
119
+ }
120
+ Color.create = create;
121
+ function is(value) {
122
+ const candidate = value;
123
+ return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
124
+ }
125
+ Color.is = is;
126
+ })(Color || (Color = {}));
127
+ var ColorInformation;
128
+ (function (ColorInformation) {
129
+ function create(range, color) {
130
+ return {
131
+ range,
132
+ color
133
+ };
134
+ }
135
+ ColorInformation.create = create;
136
+ function is(value) {
137
+ const candidate = value;
138
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
139
+ }
140
+ ColorInformation.is = is;
141
+ })(ColorInformation || (ColorInformation = {}));
142
+ var ColorPresentation;
143
+ (function (ColorPresentation) {
144
+ function create(label, textEdit, additionalTextEdits) {
145
+ return {
146
+ label,
147
+ textEdit,
148
+ additionalTextEdits
149
+ };
150
+ }
151
+ ColorPresentation.create = create;
152
+ function is(value) {
153
+ const candidate = value;
154
+ return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
155
+ }
156
+ ColorPresentation.is = is;
157
+ })(ColorPresentation || (ColorPresentation = {}));
158
+ var FoldingRangeKind;
159
+ (function (FoldingRangeKind) {
160
+ FoldingRangeKind.Comment = 'comment';
161
+ FoldingRangeKind.Imports = 'imports';
162
+ FoldingRangeKind.Region = 'region';
163
+ })(FoldingRangeKind || (FoldingRangeKind = {}));
164
+ var FoldingRange;
165
+ (function (FoldingRange) {
166
+ function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
167
+ const result = {
168
+ startLine,
169
+ endLine
170
+ };
171
+ if (Is.defined(startCharacter)) {
172
+ result.startCharacter = startCharacter;
173
+ }
174
+ if (Is.defined(endCharacter)) {
175
+ result.endCharacter = endCharacter;
176
+ }
177
+ if (Is.defined(kind)) {
178
+ result.kind = kind;
179
+ }
180
+ if (Is.defined(collapsedText)) {
181
+ result.collapsedText = collapsedText;
182
+ }
183
+ return result;
184
+ }
185
+ FoldingRange.create = create;
186
+ function is(value) {
187
+ const candidate = value;
188
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
189
+ }
190
+ FoldingRange.is = is;
191
+ })(FoldingRange || (FoldingRange = {}));
192
+ var DiagnosticRelatedInformation;
193
+ (function (DiagnosticRelatedInformation) {
194
+ function create(location, message) {
195
+ return {
196
+ location,
197
+ message
198
+ };
199
+ }
200
+ DiagnosticRelatedInformation.create = create;
201
+ function is(value) {
202
+ let candidate = value;
203
+ return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
204
+ }
205
+ DiagnosticRelatedInformation.is = is;
206
+ })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
207
+ var DiagnosticSeverity;
208
+ (function (DiagnosticSeverity) {
209
+ DiagnosticSeverity.Error = 1;
210
+ DiagnosticSeverity.Warning = 2;
211
+ DiagnosticSeverity.Information = 3;
212
+ DiagnosticSeverity.Hint = 4;
213
+ })(DiagnosticSeverity || (DiagnosticSeverity = {}));
214
+ var DiagnosticTag;
215
+ (function (DiagnosticTag) {
216
+ DiagnosticTag.Unnecessary = 1;
217
+ DiagnosticTag.Deprecated = 2;
218
+ })(DiagnosticTag || (DiagnosticTag = {}));
219
+ var CodeDescription;
220
+ (function (CodeDescription) {
221
+ function is(value) {
222
+ const candidate = value;
223
+ return Is.objectLiteral(candidate) && Is.string(candidate.href);
224
+ }
225
+ CodeDescription.is = is;
226
+ })(CodeDescription || (CodeDescription = {}));
227
+ var Diagnostic;
228
+ (function (Diagnostic) {
229
+ function create(range, message, severity, code, source, relatedInformation) {
230
+ let result = {
231
+ range,
232
+ message
233
+ };
234
+ if (Is.defined(severity)) {
235
+ result.severity = severity;
236
+ }
237
+ if (Is.defined(code)) {
238
+ result.code = code;
239
+ }
240
+ if (Is.defined(source)) {
241
+ result.source = source;
242
+ }
243
+ if (Is.defined(relatedInformation)) {
244
+ result.relatedInformation = relatedInformation;
245
+ }
246
+ return result;
247
+ }
248
+ Diagnostic.create = create;
249
+ function is(value) {
250
+ var _a;
251
+ let candidate = value;
252
+ return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
253
+ }
254
+ Diagnostic.is = is;
255
+ })(Diagnostic || (Diagnostic = {}));
256
+ var Command;
257
+ (function (Command) {
258
+ function create(title, command) {
259
+ let result = {
260
+ title,
261
+ command
262
+ };
263
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
264
+ args[_key - 2] = arguments[_key];
265
+ }
266
+ if (Is.defined(args) && args.length > 0) {
267
+ result.arguments = args;
268
+ }
269
+ return result;
270
+ }
271
+ Command.create = create;
272
+ function is(value) {
273
+ let candidate = value;
274
+ return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
275
+ }
276
+ Command.is = is;
277
+ })(Command || (Command = {}));
278
+ var TextEdit;
279
+ (function (TextEdit) {
280
+ function replace(range, newText) {
281
+ return {
282
+ range,
283
+ newText
284
+ };
285
+ }
286
+ TextEdit.replace = replace;
287
+ function insert(position, newText) {
288
+ return {
289
+ range: {
290
+ start: position,
291
+ end: position
292
+ },
293
+ newText
294
+ };
295
+ }
296
+ TextEdit.insert = insert;
297
+ function del(range) {
298
+ return {
299
+ range,
300
+ newText: ''
301
+ };
302
+ }
303
+ TextEdit.del = del;
304
+ function is(value) {
305
+ const candidate = value;
306
+ return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
307
+ }
308
+ TextEdit.is = is;
309
+ })(TextEdit || (TextEdit = {}));
310
+ var ChangeAnnotation;
311
+ (function (ChangeAnnotation) {
312
+ function create(label, needsConfirmation, description) {
313
+ const result = {
314
+ label
315
+ };
316
+ if (needsConfirmation !== undefined) {
317
+ result.needsConfirmation = needsConfirmation;
318
+ }
319
+ if (description !== undefined) {
320
+ result.description = description;
321
+ }
322
+ return result;
323
+ }
324
+ ChangeAnnotation.create = create;
325
+ function is(value) {
326
+ const candidate = value;
327
+ return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) && (Is.string(candidate.description) || candidate.description === undefined);
328
+ }
329
+ ChangeAnnotation.is = is;
330
+ })(ChangeAnnotation || (ChangeAnnotation = {}));
331
+ var ChangeAnnotationIdentifier;
332
+ (function (ChangeAnnotationIdentifier) {
333
+ function is(value) {
334
+ const candidate = value;
335
+ return Is.string(candidate);
336
+ }
337
+ ChangeAnnotationIdentifier.is = is;
338
+ })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
339
+ var AnnotatedTextEdit;
340
+ (function (AnnotatedTextEdit) {
341
+ function replace(range, newText, annotation) {
342
+ return {
343
+ range,
344
+ newText,
345
+ annotationId: annotation
346
+ };
347
+ }
348
+ AnnotatedTextEdit.replace = replace;
349
+ function insert(position, newText, annotation) {
350
+ return {
351
+ range: {
352
+ start: position,
353
+ end: position
354
+ },
355
+ newText,
356
+ annotationId: annotation
357
+ };
358
+ }
359
+ AnnotatedTextEdit.insert = insert;
360
+ function del(range, annotation) {
361
+ return {
362
+ range,
363
+ newText: '',
364
+ annotationId: annotation
365
+ };
366
+ }
367
+ AnnotatedTextEdit.del = del;
368
+ function is(value) {
369
+ const candidate = value;
370
+ return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
371
+ }
372
+ AnnotatedTextEdit.is = is;
373
+ })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
374
+ var TextDocumentEdit;
375
+ (function (TextDocumentEdit) {
376
+ function create(textDocument, edits) {
377
+ return {
378
+ textDocument,
379
+ edits
380
+ };
381
+ }
382
+ TextDocumentEdit.create = create;
383
+ function is(value) {
384
+ let candidate = value;
385
+ return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
386
+ }
387
+ TextDocumentEdit.is = is;
388
+ })(TextDocumentEdit || (TextDocumentEdit = {}));
389
+ var CreateFile;
390
+ (function (CreateFile) {
391
+ function create(uri, options, annotation) {
392
+ let result = {
393
+ kind: 'create',
394
+ uri
395
+ };
396
+ if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
397
+ result.options = options;
398
+ }
399
+ if (annotation !== undefined) {
400
+ result.annotationId = annotation;
401
+ }
402
+ return result;
403
+ }
404
+ CreateFile.create = create;
405
+ function is(value) {
406
+ let candidate = value;
407
+ return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined || (candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
408
+ }
409
+ CreateFile.is = is;
410
+ })(CreateFile || (CreateFile = {}));
411
+ var RenameFile;
412
+ (function (RenameFile) {
413
+ function create(oldUri, newUri, options, annotation) {
414
+ let result = {
415
+ kind: 'rename',
416
+ oldUri,
417
+ newUri
418
+ };
419
+ if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
420
+ result.options = options;
421
+ }
422
+ if (annotation !== undefined) {
423
+ result.annotationId = annotation;
424
+ }
425
+ return result;
426
+ }
427
+ RenameFile.create = create;
428
+ function is(value) {
429
+ let candidate = value;
430
+ return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined || (candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
431
+ }
432
+ RenameFile.is = is;
433
+ })(RenameFile || (RenameFile = {}));
434
+ var DeleteFile;
435
+ (function (DeleteFile) {
436
+ function create(uri, options, annotation) {
437
+ let result = {
438
+ kind: 'delete',
439
+ uri
440
+ };
441
+ if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {
442
+ result.options = options;
443
+ }
444
+ if (annotation !== undefined) {
445
+ result.annotationId = annotation;
446
+ }
447
+ return result;
448
+ }
449
+ DeleteFile.create = create;
450
+ function is(value) {
451
+ let candidate = value;
452
+ return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined || (candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
453
+ }
454
+ DeleteFile.is = is;
455
+ })(DeleteFile || (DeleteFile = {}));
456
+ var WorkspaceEdit;
457
+ (function (WorkspaceEdit) {
458
+ function is(value) {
459
+ let candidate = value;
460
+ return candidate && (candidate.changes !== undefined || candidate.documentChanges !== undefined) && (candidate.documentChanges === undefined || candidate.documentChanges.every(change => {
461
+ if (Is.string(change.kind)) {
462
+ return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
463
+ } else {
464
+ return TextDocumentEdit.is(change);
465
+ }
466
+ }));
467
+ }
468
+ WorkspaceEdit.is = is;
469
+ })(WorkspaceEdit || (WorkspaceEdit = {}));
470
+ class TextEditChangeImpl {
471
+ constructor(edits, changeAnnotations) {
472
+ this.edits = edits;
473
+ this.changeAnnotations = changeAnnotations;
474
+ }
475
+ insert(position, newText, annotation) {
476
+ let edit;
477
+ let id;
478
+ if (annotation === undefined) {
479
+ edit = TextEdit.insert(position, newText);
480
+ } else if (ChangeAnnotationIdentifier.is(annotation)) {
481
+ id = annotation;
482
+ edit = AnnotatedTextEdit.insert(position, newText, annotation);
483
+ } else {
484
+ this.assertChangeAnnotations(this.changeAnnotations);
485
+ id = this.changeAnnotations.manage(annotation);
486
+ edit = AnnotatedTextEdit.insert(position, newText, id);
487
+ }
488
+ this.edits.push(edit);
489
+ if (id !== undefined) {
490
+ return id;
491
+ }
492
+ }
493
+ replace(range, newText, annotation) {
494
+ let edit;
495
+ let id;
496
+ if (annotation === undefined) {
497
+ edit = TextEdit.replace(range, newText);
498
+ } else if (ChangeAnnotationIdentifier.is(annotation)) {
499
+ id = annotation;
500
+ edit = AnnotatedTextEdit.replace(range, newText, annotation);
501
+ } else {
502
+ this.assertChangeAnnotations(this.changeAnnotations);
503
+ id = this.changeAnnotations.manage(annotation);
504
+ edit = AnnotatedTextEdit.replace(range, newText, id);
505
+ }
506
+ this.edits.push(edit);
507
+ if (id !== undefined) {
508
+ return id;
509
+ }
510
+ }
511
+ delete(range, annotation) {
512
+ let edit;
513
+ let id;
514
+ if (annotation === undefined) {
515
+ edit = TextEdit.del(range);
516
+ } else if (ChangeAnnotationIdentifier.is(annotation)) {
517
+ id = annotation;
518
+ edit = AnnotatedTextEdit.del(range, annotation);
519
+ } else {
520
+ this.assertChangeAnnotations(this.changeAnnotations);
521
+ id = this.changeAnnotations.manage(annotation);
522
+ edit = AnnotatedTextEdit.del(range, id);
523
+ }
524
+ this.edits.push(edit);
525
+ if (id !== undefined) {
526
+ return id;
527
+ }
528
+ }
529
+ add(edit) {
530
+ this.edits.push(edit);
531
+ }
532
+ all() {
533
+ return this.edits;
534
+ }
535
+ clear() {
536
+ this.edits.splice(0, this.edits.length);
537
+ }
538
+ assertChangeAnnotations(value) {
539
+ if (value === undefined) {
540
+ throw new Error("Text edit change is not configured to manage change annotations.");
541
+ }
542
+ }
543
+ }
544
+ class ChangeAnnotations {
545
+ constructor(annotations) {
546
+ this._annotations = annotations === undefined ? Object.create(null) : annotations;
547
+ this._counter = 0;
548
+ this._size = 0;
549
+ }
550
+ all() {
551
+ return this._annotations;
552
+ }
553
+ get size() {
554
+ return this._size;
555
+ }
556
+ manage(idOrAnnotation, annotation) {
557
+ let id;
558
+ if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
559
+ id = idOrAnnotation;
560
+ } else {
561
+ id = this.nextId();
562
+ annotation = idOrAnnotation;
563
+ }
564
+ if (this._annotations[id] !== undefined) {
565
+ throw new Error("Id ".concat(id, " is already in use."));
566
+ }
567
+ if (annotation === undefined) {
568
+ throw new Error("No annotation provided for id ".concat(id));
569
+ }
570
+ this._annotations[id] = annotation;
571
+ this._size++;
572
+ return id;
573
+ }
574
+ nextId() {
575
+ this._counter++;
576
+ return this._counter.toString();
577
+ }
578
+ }
579
+ class WorkspaceChange {
580
+ constructor(workspaceEdit) {
581
+ this._textEditChanges = Object.create(null);
582
+ if (workspaceEdit !== undefined) {
583
+ this._workspaceEdit = workspaceEdit;
584
+ if (workspaceEdit.documentChanges) {
585
+ this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
586
+ workspaceEdit.changeAnnotations = this._changeAnnotations.all();
587
+ workspaceEdit.documentChanges.forEach(change => {
588
+ if (TextDocumentEdit.is(change)) {
589
+ const textEditChange = new TextEditChangeImpl(change.edits, this._changeAnnotations);
590
+ this._textEditChanges[change.textDocument.uri] = textEditChange;
591
+ }
592
+ });
593
+ } else if (workspaceEdit.changes) {
594
+ Object.keys(workspaceEdit.changes).forEach(key => {
595
+ const textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
596
+ this._textEditChanges[key] = textEditChange;
597
+ });
598
+ }
599
+ } else {
600
+ this._workspaceEdit = {};
601
+ }
602
+ }
603
+ get edit() {
604
+ this.initDocumentChanges();
605
+ if (this._changeAnnotations !== undefined) {
606
+ if (this._changeAnnotations.size === 0) {
607
+ this._workspaceEdit.changeAnnotations = undefined;
608
+ } else {
609
+ this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
610
+ }
611
+ }
612
+ return this._workspaceEdit;
613
+ }
614
+ getTextEditChange(key) {
615
+ if (OptionalVersionedTextDocumentIdentifier.is(key)) {
616
+ this.initDocumentChanges();
617
+ if (this._workspaceEdit.documentChanges === undefined) {
618
+ throw new Error('Workspace edit is not configured for document changes.');
619
+ }
620
+ const textDocument = {
621
+ uri: key.uri,
622
+ version: key.version
623
+ };
624
+ let result = this._textEditChanges[textDocument.uri];
625
+ if (!result) {
626
+ const edits = [];
627
+ const textDocumentEdit = {
628
+ textDocument,
629
+ edits
630
+ };
631
+ this._workspaceEdit.documentChanges.push(textDocumentEdit);
632
+ result = new TextEditChangeImpl(edits, this._changeAnnotations);
633
+ this._textEditChanges[textDocument.uri] = result;
634
+ }
635
+ return result;
636
+ } else {
637
+ this.initChanges();
638
+ if (this._workspaceEdit.changes === undefined) {
639
+ throw new Error('Workspace edit is not configured for normal text edit changes.');
640
+ }
641
+ let result = this._textEditChanges[key];
642
+ if (!result) {
643
+ let edits = [];
644
+ this._workspaceEdit.changes[key] = edits;
645
+ result = new TextEditChangeImpl(edits);
646
+ this._textEditChanges[key] = result;
647
+ }
648
+ return result;
649
+ }
650
+ }
651
+ initDocumentChanges() {
652
+ if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
653
+ this._changeAnnotations = new ChangeAnnotations();
654
+ this._workspaceEdit.documentChanges = [];
655
+ this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
656
+ }
657
+ }
658
+ initChanges() {
659
+ if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
660
+ this._workspaceEdit.changes = Object.create(null);
661
+ }
662
+ }
663
+ createFile(uri, optionsOrAnnotation, options) {
664
+ this.initDocumentChanges();
665
+ if (this._workspaceEdit.documentChanges === undefined) {
666
+ throw new Error('Workspace edit is not configured for document changes.');
667
+ }
668
+ let annotation;
669
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
670
+ annotation = optionsOrAnnotation;
671
+ } else {
672
+ options = optionsOrAnnotation;
673
+ }
674
+ let operation;
675
+ let id;
676
+ if (annotation === undefined) {
677
+ operation = CreateFile.create(uri, options);
678
+ } else {
679
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
680
+ operation = CreateFile.create(uri, options, id);
681
+ }
682
+ this._workspaceEdit.documentChanges.push(operation);
683
+ if (id !== undefined) {
684
+ return id;
685
+ }
686
+ }
687
+ renameFile(oldUri, newUri, optionsOrAnnotation, options) {
688
+ this.initDocumentChanges();
689
+ if (this._workspaceEdit.documentChanges === undefined) {
690
+ throw new Error('Workspace edit is not configured for document changes.');
691
+ }
692
+ let annotation;
693
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
694
+ annotation = optionsOrAnnotation;
695
+ } else {
696
+ options = optionsOrAnnotation;
697
+ }
698
+ let operation;
699
+ let id;
700
+ if (annotation === undefined) {
701
+ operation = RenameFile.create(oldUri, newUri, options);
702
+ } else {
703
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
704
+ operation = RenameFile.create(oldUri, newUri, options, id);
705
+ }
706
+ this._workspaceEdit.documentChanges.push(operation);
707
+ if (id !== undefined) {
708
+ return id;
709
+ }
710
+ }
711
+ deleteFile(uri, optionsOrAnnotation, options) {
712
+ this.initDocumentChanges();
713
+ if (this._workspaceEdit.documentChanges === undefined) {
714
+ throw new Error('Workspace edit is not configured for document changes.');
715
+ }
716
+ let annotation;
717
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
718
+ annotation = optionsOrAnnotation;
719
+ } else {
720
+ options = optionsOrAnnotation;
721
+ }
722
+ let operation;
723
+ let id;
724
+ if (annotation === undefined) {
725
+ operation = DeleteFile.create(uri, options);
726
+ } else {
727
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
728
+ operation = DeleteFile.create(uri, options, id);
729
+ }
730
+ this._workspaceEdit.documentChanges.push(operation);
731
+ if (id !== undefined) {
732
+ return id;
733
+ }
734
+ }
735
+ }
736
+ var TextDocumentIdentifier;
737
+ (function (TextDocumentIdentifier) {
738
+ function create(uri) {
739
+ return {
740
+ uri
741
+ };
742
+ }
743
+ TextDocumentIdentifier.create = create;
744
+ function is(value) {
745
+ let candidate = value;
746
+ return Is.defined(candidate) && Is.string(candidate.uri);
747
+ }
748
+ TextDocumentIdentifier.is = is;
749
+ })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
750
+ var VersionedTextDocumentIdentifier;
751
+ (function (VersionedTextDocumentIdentifier) {
752
+ function create(uri, version) {
753
+ return {
754
+ uri,
755
+ version
756
+ };
757
+ }
758
+ VersionedTextDocumentIdentifier.create = create;
759
+ function is(value) {
760
+ let candidate = value;
761
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
762
+ }
763
+ VersionedTextDocumentIdentifier.is = is;
764
+ })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
765
+ var OptionalVersionedTextDocumentIdentifier;
766
+ (function (OptionalVersionedTextDocumentIdentifier) {
767
+ function create(uri, version) {
768
+ return {
769
+ uri,
770
+ version
771
+ };
772
+ }
773
+ OptionalVersionedTextDocumentIdentifier.create = create;
774
+ function is(value) {
775
+ let candidate = value;
776
+ return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
777
+ }
778
+ OptionalVersionedTextDocumentIdentifier.is = is;
779
+ })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
780
+ var TextDocumentItem;
781
+ (function (TextDocumentItem) {
782
+ function create(uri, languageId, version, text) {
783
+ return {
784
+ uri,
785
+ languageId,
786
+ version,
787
+ text
788
+ };
789
+ }
790
+ TextDocumentItem.create = create;
791
+ function is(value) {
792
+ let candidate = value;
793
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
794
+ }
795
+ TextDocumentItem.is = is;
796
+ })(TextDocumentItem || (TextDocumentItem = {}));
797
+ var MarkupKind;
798
+ (function (MarkupKind) {
799
+ MarkupKind.PlainText = 'plaintext';
800
+ MarkupKind.Markdown = 'markdown';
801
+ function is(value) {
802
+ const candidate = value;
803
+ return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
804
+ }
805
+ MarkupKind.is = is;
806
+ })(MarkupKind || (MarkupKind = {}));
807
+ var MarkupContent;
808
+ (function (MarkupContent) {
809
+ function is(value) {
810
+ const candidate = value;
811
+ return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
812
+ }
813
+ MarkupContent.is = is;
814
+ })(MarkupContent || (MarkupContent = {}));
815
+ var CompletionItemKind;
816
+ (function (CompletionItemKind) {
817
+ CompletionItemKind.Text = 1;
818
+ CompletionItemKind.Method = 2;
819
+ CompletionItemKind.Function = 3;
820
+ CompletionItemKind.Constructor = 4;
821
+ CompletionItemKind.Field = 5;
822
+ CompletionItemKind.Variable = 6;
823
+ CompletionItemKind.Class = 7;
824
+ CompletionItemKind.Interface = 8;
825
+ CompletionItemKind.Module = 9;
826
+ CompletionItemKind.Property = 10;
827
+ CompletionItemKind.Unit = 11;
828
+ CompletionItemKind.Value = 12;
829
+ CompletionItemKind.Enum = 13;
830
+ CompletionItemKind.Keyword = 14;
831
+ CompletionItemKind.Snippet = 15;
832
+ CompletionItemKind.Color = 16;
833
+ CompletionItemKind.File = 17;
834
+ CompletionItemKind.Reference = 18;
835
+ CompletionItemKind.Folder = 19;
836
+ CompletionItemKind.EnumMember = 20;
837
+ CompletionItemKind.Constant = 21;
838
+ CompletionItemKind.Struct = 22;
839
+ CompletionItemKind.Event = 23;
840
+ CompletionItemKind.Operator = 24;
841
+ CompletionItemKind.TypeParameter = 25;
842
+ })(CompletionItemKind || (CompletionItemKind = {}));
843
+ var InsertTextFormat;
844
+ (function (InsertTextFormat) {
845
+ InsertTextFormat.PlainText = 1;
846
+ InsertTextFormat.Snippet = 2;
847
+ })(InsertTextFormat || (InsertTextFormat = {}));
848
+ var CompletionItemTag;
849
+ (function (CompletionItemTag) {
850
+ CompletionItemTag.Deprecated = 1;
851
+ })(CompletionItemTag || (CompletionItemTag = {}));
852
+ var InsertReplaceEdit;
853
+ (function (InsertReplaceEdit) {
854
+ function create(newText, insert, replace) {
855
+ return {
856
+ newText,
857
+ insert,
858
+ replace
859
+ };
860
+ }
861
+ InsertReplaceEdit.create = create;
862
+ function is(value) {
863
+ const candidate = value;
864
+ return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
865
+ }
866
+ InsertReplaceEdit.is = is;
867
+ })(InsertReplaceEdit || (InsertReplaceEdit = {}));
868
+ var InsertTextMode;
869
+ (function (InsertTextMode) {
870
+ InsertTextMode.asIs = 1;
871
+ InsertTextMode.adjustIndentation = 2;
872
+ })(InsertTextMode || (InsertTextMode = {}));
873
+ var CompletionItemLabelDetails;
874
+ (function (CompletionItemLabelDetails) {
875
+ function is(value) {
876
+ const candidate = value;
877
+ return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) && (Is.string(candidate.description) || candidate.description === undefined);
878
+ }
879
+ CompletionItemLabelDetails.is = is;
880
+ })(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));
881
+ var CompletionItem;
882
+ (function (CompletionItem) {
883
+ function create(label) {
884
+ return {
885
+ label
886
+ };
887
+ }
888
+ CompletionItem.create = create;
889
+ })(CompletionItem || (CompletionItem = {}));
890
+ var CompletionList;
891
+ (function (CompletionList) {
892
+ function create(items, isIncomplete) {
893
+ return {
894
+ items: items ? items : [],
895
+ isIncomplete: !!isIncomplete
896
+ };
897
+ }
898
+ CompletionList.create = create;
899
+ })(CompletionList || (CompletionList = {}));
900
+ var MarkedString;
901
+ (function (MarkedString) {
902
+ function fromPlainText(plainText) {
903
+ return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&');
904
+ }
905
+ MarkedString.fromPlainText = fromPlainText;
906
+ function is(value) {
907
+ const candidate = value;
908
+ return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
909
+ }
910
+ MarkedString.is = is;
911
+ })(MarkedString || (MarkedString = {}));
912
+ var Hover;
913
+ (function (Hover) {
914
+ function is(value) {
915
+ let candidate = value;
916
+ return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));
917
+ }
918
+ Hover.is = is;
919
+ })(Hover || (Hover = {}));
920
+ var ParameterInformation;
921
+ (function (ParameterInformation) {
922
+ function create(label, documentation) {
923
+ return documentation ? {
924
+ label,
925
+ documentation
926
+ } : {
927
+ label
928
+ };
929
+ }
930
+ ParameterInformation.create = create;
931
+ })(ParameterInformation || (ParameterInformation = {}));
932
+ var SignatureInformation;
933
+ (function (SignatureInformation) {
934
+ function create(label, documentation) {
935
+ let result = {
936
+ label
937
+ };
938
+ if (Is.defined(documentation)) {
939
+ result.documentation = documentation;
940
+ }
941
+ for (var _len2 = arguments.length, parameters = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
942
+ parameters[_key2 - 2] = arguments[_key2];
943
+ }
944
+ if (Is.defined(parameters)) {
945
+ result.parameters = parameters;
946
+ } else {
947
+ result.parameters = [];
948
+ }
949
+ return result;
950
+ }
951
+ SignatureInformation.create = create;
952
+ })(SignatureInformation || (SignatureInformation = {}));
953
+ var DocumentHighlightKind;
954
+ (function (DocumentHighlightKind) {
955
+ DocumentHighlightKind.Text = 1;
956
+ DocumentHighlightKind.Read = 2;
957
+ DocumentHighlightKind.Write = 3;
958
+ })(DocumentHighlightKind || (DocumentHighlightKind = {}));
959
+ var DocumentHighlight;
960
+ (function (DocumentHighlight) {
961
+ function create(range, kind) {
962
+ let result = {
963
+ range
964
+ };
965
+ if (Is.number(kind)) {
966
+ result.kind = kind;
967
+ }
968
+ return result;
969
+ }
970
+ DocumentHighlight.create = create;
971
+ })(DocumentHighlight || (DocumentHighlight = {}));
972
+ var SymbolKind;
973
+ (function (SymbolKind) {
974
+ SymbolKind.File = 1;
975
+ SymbolKind.Module = 2;
976
+ SymbolKind.Namespace = 3;
977
+ SymbolKind.Package = 4;
978
+ SymbolKind.Class = 5;
979
+ SymbolKind.Method = 6;
980
+ SymbolKind.Property = 7;
981
+ SymbolKind.Field = 8;
982
+ SymbolKind.Constructor = 9;
983
+ SymbolKind.Enum = 10;
984
+ SymbolKind.Interface = 11;
985
+ SymbolKind.Function = 12;
986
+ SymbolKind.Variable = 13;
987
+ SymbolKind.Constant = 14;
988
+ SymbolKind.String = 15;
989
+ SymbolKind.Number = 16;
990
+ SymbolKind.Boolean = 17;
991
+ SymbolKind.Array = 18;
992
+ SymbolKind.Object = 19;
993
+ SymbolKind.Key = 20;
994
+ SymbolKind.Null = 21;
995
+ SymbolKind.EnumMember = 22;
996
+ SymbolKind.Struct = 23;
997
+ SymbolKind.Event = 24;
998
+ SymbolKind.Operator = 25;
999
+ SymbolKind.TypeParameter = 26;
1000
+ })(SymbolKind || (SymbolKind = {}));
1001
+ var SymbolTag;
1002
+ (function (SymbolTag) {
1003
+ SymbolTag.Deprecated = 1;
1004
+ })(SymbolTag || (SymbolTag = {}));
1005
+ var SymbolInformation;
1006
+ (function (SymbolInformation) {
1007
+ function create(name, kind, range, uri, containerName) {
1008
+ let result = {
1009
+ name,
1010
+ kind,
1011
+ location: {
1012
+ uri,
1013
+ range
1014
+ }
1015
+ };
1016
+ if (containerName) {
1017
+ result.containerName = containerName;
1018
+ }
1019
+ return result;
1020
+ }
1021
+ SymbolInformation.create = create;
1022
+ })(SymbolInformation || (SymbolInformation = {}));
1023
+ var WorkspaceSymbol;
1024
+ (function (WorkspaceSymbol) {
1025
+ function create(name, kind, uri, range) {
1026
+ return range !== undefined ? {
1027
+ name,
1028
+ kind,
1029
+ location: {
1030
+ uri,
1031
+ range
1032
+ }
1033
+ } : {
1034
+ name,
1035
+ kind,
1036
+ location: {
1037
+ uri
1038
+ }
1039
+ };
1040
+ }
1041
+ WorkspaceSymbol.create = create;
1042
+ })(WorkspaceSymbol || (WorkspaceSymbol = {}));
1043
+ var DocumentSymbol;
1044
+ (function (DocumentSymbol) {
1045
+ function create(name, detail, kind, range, selectionRange, children) {
1046
+ let result = {
1047
+ name,
1048
+ detail,
1049
+ kind,
1050
+ range,
1051
+ selectionRange
1052
+ };
1053
+ if (children !== undefined) {
1054
+ result.children = children;
1055
+ }
1056
+ return result;
1057
+ }
1058
+ DocumentSymbol.create = create;
1059
+ function is(value) {
1060
+ let candidate = value;
1061
+ return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === undefined || Is.string(candidate.detail)) && (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) && (candidate.children === undefined || Array.isArray(candidate.children)) && (candidate.tags === undefined || Array.isArray(candidate.tags));
1062
+ }
1063
+ DocumentSymbol.is = is;
1064
+ })(DocumentSymbol || (DocumentSymbol = {}));
1065
+ var CodeActionKind;
1066
+ (function (CodeActionKind) {
1067
+ CodeActionKind.Empty = '';
1068
+ CodeActionKind.QuickFix = 'quickfix';
1069
+ CodeActionKind.Refactor = 'refactor';
1070
+ CodeActionKind.RefactorExtract = 'refactor.extract';
1071
+ CodeActionKind.RefactorInline = 'refactor.inline';
1072
+ CodeActionKind.RefactorRewrite = 'refactor.rewrite';
1073
+ CodeActionKind.Source = 'source';
1074
+ CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
1075
+ CodeActionKind.SourceFixAll = 'source.fixAll';
1076
+ })(CodeActionKind || (CodeActionKind = {}));
1077
+ var CodeActionTriggerKind;
1078
+ (function (CodeActionTriggerKind) {
1079
+ CodeActionTriggerKind.Invoked = 1;
1080
+ CodeActionTriggerKind.Automatic = 2;
1081
+ })(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
1082
+ var CodeActionContext;
1083
+ (function (CodeActionContext) {
1084
+ function create(diagnostics, only, triggerKind) {
1085
+ let result = {
1086
+ diagnostics
1087
+ };
1088
+ if (only !== undefined && only !== null) {
1089
+ result.only = only;
1090
+ }
1091
+ if (triggerKind !== undefined && triggerKind !== null) {
1092
+ result.triggerKind = triggerKind;
1093
+ }
1094
+ return result;
1095
+ }
1096
+ CodeActionContext.create = create;
1097
+ function is(value) {
1098
+ let candidate = value;
1099
+ return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
1100
+ }
1101
+ CodeActionContext.is = is;
1102
+ })(CodeActionContext || (CodeActionContext = {}));
1103
+ var CodeAction;
1104
+ (function (CodeAction) {
1105
+ function create(title, kindOrCommandOrEdit, kind) {
1106
+ let result = {
1107
+ title
1108
+ };
1109
+ let checkKind = true;
1110
+ if (typeof kindOrCommandOrEdit === 'string') {
1111
+ checkKind = false;
1112
+ result.kind = kindOrCommandOrEdit;
1113
+ } else if (Command.is(kindOrCommandOrEdit)) {
1114
+ result.command = kindOrCommandOrEdit;
1115
+ } else {
1116
+ result.edit = kindOrCommandOrEdit;
1117
+ }
1118
+ if (checkKind && kind !== undefined) {
1119
+ result.kind = kind;
1120
+ }
1121
+ return result;
1122
+ }
1123
+ CodeAction.create = create;
1124
+ function is(value) {
1125
+ let candidate = value;
1126
+ return candidate && Is.string(candidate.title) && (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === undefined || Is.string(candidate.kind)) && (candidate.edit !== undefined || candidate.command !== undefined) && (candidate.command === undefined || Command.is(candidate.command)) && (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) && (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));
1127
+ }
1128
+ CodeAction.is = is;
1129
+ })(CodeAction || (CodeAction = {}));
1130
+ var CodeLens;
1131
+ (function (CodeLens) {
1132
+ function create(range, data) {
1133
+ let result = {
1134
+ range
1135
+ };
1136
+ if (Is.defined(data)) {
1137
+ result.data = data;
1138
+ }
1139
+ return result;
1140
+ }
1141
+ CodeLens.create = create;
1142
+ function is(value) {
1143
+ let candidate = value;
1144
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
1145
+ }
1146
+ CodeLens.is = is;
1147
+ })(CodeLens || (CodeLens = {}));
1148
+ var FormattingOptions;
1149
+ (function (FormattingOptions) {
1150
+ function create(tabSize, insertSpaces) {
1151
+ return {
1152
+ tabSize,
1153
+ insertSpaces
1154
+ };
1155
+ }
1156
+ FormattingOptions.create = create;
1157
+ function is(value) {
1158
+ let candidate = value;
1159
+ return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
1160
+ }
1161
+ FormattingOptions.is = is;
1162
+ })(FormattingOptions || (FormattingOptions = {}));
1163
+ var DocumentLink;
1164
+ (function (DocumentLink) {
1165
+ function create(range, target, data) {
1166
+ return {
1167
+ range,
1168
+ target,
1169
+ data
1170
+ };
1171
+ }
1172
+ DocumentLink.create = create;
1173
+ function is(value) {
1174
+ let candidate = value;
1175
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
1176
+ }
1177
+ DocumentLink.is = is;
1178
+ })(DocumentLink || (DocumentLink = {}));
1179
+ var SelectionRange;
1180
+ (function (SelectionRange) {
1181
+ function create(range, parent) {
1182
+ return {
1183
+ range,
1184
+ parent
1185
+ };
1186
+ }
1187
+ SelectionRange.create = create;
1188
+ function is(value) {
1189
+ let candidate = value;
1190
+ return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
1191
+ }
1192
+ SelectionRange.is = is;
1193
+ })(SelectionRange || (SelectionRange = {}));
1194
+ var SemanticTokenTypes;
1195
+ (function (SemanticTokenTypes) {
1196
+ SemanticTokenTypes["namespace"] = "namespace";
1197
+ SemanticTokenTypes["type"] = "type";
1198
+ SemanticTokenTypes["class"] = "class";
1199
+ SemanticTokenTypes["enum"] = "enum";
1200
+ SemanticTokenTypes["interface"] = "interface";
1201
+ SemanticTokenTypes["struct"] = "struct";
1202
+ SemanticTokenTypes["typeParameter"] = "typeParameter";
1203
+ SemanticTokenTypes["parameter"] = "parameter";
1204
+ SemanticTokenTypes["variable"] = "variable";
1205
+ SemanticTokenTypes["property"] = "property";
1206
+ SemanticTokenTypes["enumMember"] = "enumMember";
1207
+ SemanticTokenTypes["event"] = "event";
1208
+ SemanticTokenTypes["function"] = "function";
1209
+ SemanticTokenTypes["method"] = "method";
1210
+ SemanticTokenTypes["macro"] = "macro";
1211
+ SemanticTokenTypes["keyword"] = "keyword";
1212
+ SemanticTokenTypes["modifier"] = "modifier";
1213
+ SemanticTokenTypes["comment"] = "comment";
1214
+ SemanticTokenTypes["string"] = "string";
1215
+ SemanticTokenTypes["number"] = "number";
1216
+ SemanticTokenTypes["regexp"] = "regexp";
1217
+ SemanticTokenTypes["operator"] = "operator";
1218
+ SemanticTokenTypes["decorator"] = "decorator";
1219
+ })(SemanticTokenTypes || (SemanticTokenTypes = {}));
1220
+ var SemanticTokenModifiers;
1221
+ (function (SemanticTokenModifiers) {
1222
+ SemanticTokenModifiers["declaration"] = "declaration";
1223
+ SemanticTokenModifiers["definition"] = "definition";
1224
+ SemanticTokenModifiers["readonly"] = "readonly";
1225
+ SemanticTokenModifiers["static"] = "static";
1226
+ SemanticTokenModifiers["deprecated"] = "deprecated";
1227
+ SemanticTokenModifiers["abstract"] = "abstract";
1228
+ SemanticTokenModifiers["async"] = "async";
1229
+ SemanticTokenModifiers["modification"] = "modification";
1230
+ SemanticTokenModifiers["documentation"] = "documentation";
1231
+ SemanticTokenModifiers["defaultLibrary"] = "defaultLibrary";
1232
+ })(SemanticTokenModifiers || (SemanticTokenModifiers = {}));
1233
+ var SemanticTokens;
1234
+ (function (SemanticTokens) {
1235
+ function is(value) {
1236
+ const candidate = value;
1237
+ return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');
1238
+ }
1239
+ SemanticTokens.is = is;
1240
+ })(SemanticTokens || (SemanticTokens = {}));
1241
+ var InlineValueText;
1242
+ (function (InlineValueText) {
1243
+ function create(range, text) {
1244
+ return {
1245
+ range,
1246
+ text
1247
+ };
1248
+ }
1249
+ InlineValueText.create = create;
1250
+ function is(value) {
1251
+ const candidate = value;
1252
+ return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
1253
+ }
1254
+ InlineValueText.is = is;
1255
+ })(InlineValueText || (InlineValueText = {}));
1256
+ var InlineValueVariableLookup;
1257
+ (function (InlineValueVariableLookup) {
1258
+ function create(range, variableName, caseSensitiveLookup) {
1259
+ return {
1260
+ range,
1261
+ variableName,
1262
+ caseSensitiveLookup
1263
+ };
1264
+ }
1265
+ InlineValueVariableLookup.create = create;
1266
+ function is(value) {
1267
+ const candidate = value;
1268
+ return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === undefined);
1269
+ }
1270
+ InlineValueVariableLookup.is = is;
1271
+ })(InlineValueVariableLookup || (InlineValueVariableLookup = {}));
1272
+ var InlineValueEvaluatableExpression;
1273
+ (function (InlineValueEvaluatableExpression) {
1274
+ function create(range, expression) {
1275
+ return {
1276
+ range,
1277
+ expression
1278
+ };
1279
+ }
1280
+ InlineValueEvaluatableExpression.create = create;
1281
+ function is(value) {
1282
+ const candidate = value;
1283
+ return candidate !== undefined && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === undefined);
1284
+ }
1285
+ InlineValueEvaluatableExpression.is = is;
1286
+ })(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));
1287
+ var InlineValueContext;
1288
+ (function (InlineValueContext) {
1289
+ function create(frameId, stoppedLocation) {
1290
+ return {
1291
+ frameId,
1292
+ stoppedLocation
1293
+ };
1294
+ }
1295
+ InlineValueContext.create = create;
1296
+ function is(value) {
1297
+ const candidate = value;
1298
+ return Is.defined(candidate) && Range.is(value.stoppedLocation);
1299
+ }
1300
+ InlineValueContext.is = is;
1301
+ })(InlineValueContext || (InlineValueContext = {}));
1302
+ var InlayHintKind;
1303
+ (function (InlayHintKind) {
1304
+ InlayHintKind.Type = 1;
1305
+ InlayHintKind.Parameter = 2;
1306
+ function is(value) {
1307
+ return value === 1 || value === 2;
1308
+ }
1309
+ InlayHintKind.is = is;
1310
+ })(InlayHintKind || (InlayHintKind = {}));
1311
+ var InlayHintLabelPart;
1312
+ (function (InlayHintLabelPart) {
1313
+ function create(value) {
1314
+ return {
1315
+ value
1316
+ };
1317
+ }
1318
+ InlayHintLabelPart.create = create;
1319
+ function is(value) {
1320
+ const candidate = value;
1321
+ return Is.objectLiteral(candidate) && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === undefined || Location.is(candidate.location)) && (candidate.command === undefined || Command.is(candidate.command));
1322
+ }
1323
+ InlayHintLabelPart.is = is;
1324
+ })(InlayHintLabelPart || (InlayHintLabelPart = {}));
1325
+ var InlayHint;
1326
+ (function (InlayHint) {
1327
+ function create(position, label, kind) {
1328
+ const result = {
1329
+ position,
1330
+ label
1331
+ };
1332
+ if (kind !== undefined) {
1333
+ result.kind = kind;
1334
+ }
1335
+ return result;
1336
+ }
1337
+ InlayHint.create = create;
1338
+ function is(value) {
1339
+ const candidate = value;
1340
+ return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === undefined || InlayHintKind.is(candidate.kind)) && candidate.textEdits === undefined || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight));
1341
+ }
1342
+ InlayHint.is = is;
1343
+ })(InlayHint || (InlayHint = {}));
1344
+ var StringValue;
1345
+ (function (StringValue) {
1346
+ function createSnippet(value) {
1347
+ return {
1348
+ kind: 'snippet',
1349
+ value
1350
+ };
1351
+ }
1352
+ StringValue.createSnippet = createSnippet;
1353
+ })(StringValue || (StringValue = {}));
1354
+ var InlineCompletionItem;
1355
+ (function (InlineCompletionItem) {
1356
+ function create(insertText, filterText, range, command) {
1357
+ return {
1358
+ insertText,
1359
+ filterText,
1360
+ range,
1361
+ command
1362
+ };
1363
+ }
1364
+ InlineCompletionItem.create = create;
1365
+ })(InlineCompletionItem || (InlineCompletionItem = {}));
1366
+ var InlineCompletionList;
1367
+ (function (InlineCompletionList) {
1368
+ function create(items) {
1369
+ return {
1370
+ items
1371
+ };
1372
+ }
1373
+ InlineCompletionList.create = create;
1374
+ })(InlineCompletionList || (InlineCompletionList = {}));
1375
+ var InlineCompletionTriggerKind;
1376
+ (function (InlineCompletionTriggerKind) {
1377
+ InlineCompletionTriggerKind.Invoked = 0;
1378
+ InlineCompletionTriggerKind.Automatic = 1;
1379
+ })(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
1380
+ var SelectedCompletionInfo;
1381
+ (function (SelectedCompletionInfo) {
1382
+ function create(range, text) {
1383
+ return {
1384
+ range,
1385
+ text
1386
+ };
1387
+ }
1388
+ SelectedCompletionInfo.create = create;
1389
+ })(SelectedCompletionInfo || (SelectedCompletionInfo = {}));
1390
+ var InlineCompletionContext;
1391
+ (function (InlineCompletionContext) {
1392
+ function create(triggerKind, selectedCompletionInfo) {
1393
+ return {
1394
+ triggerKind,
1395
+ selectedCompletionInfo
1396
+ };
1397
+ }
1398
+ InlineCompletionContext.create = create;
1399
+ })(InlineCompletionContext || (InlineCompletionContext = {}));
1400
+ var WorkspaceFolder;
1401
+ (function (WorkspaceFolder) {
1402
+ function is(value) {
1403
+ const candidate = value;
1404
+ return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
1405
+ }
1406
+ WorkspaceFolder.is = is;
1407
+ })(WorkspaceFolder || (WorkspaceFolder = {}));
1408
+ const EOL = ['\n', '\r\n', '\r'];
1409
+ var TextDocument;
1410
+ (function (TextDocument) {
1411
+ function create(uri, languageId, version, content) {
1412
+ return new FullTextDocument(uri, languageId, version, content);
1413
+ }
1414
+ TextDocument.create = create;
1415
+ function is(value) {
1416
+ let candidate = value;
1417
+ return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
1418
+ }
1419
+ TextDocument.is = is;
1420
+ function applyEdits(document, edits) {
1421
+ let text = document.getText();
1422
+ let sortedEdits = mergeSort(edits, (a, b) => {
1423
+ let diff = a.range.start.line - b.range.start.line;
1424
+ if (diff === 0) {
1425
+ return a.range.start.character - b.range.start.character;
1426
+ }
1427
+ return diff;
1428
+ });
1429
+ let lastModifiedOffset = text.length;
1430
+ for (let i = sortedEdits.length - 1; i >= 0; i--) {
1431
+ let e = sortedEdits[i];
1432
+ let startOffset = document.offsetAt(e.range.start);
1433
+ let endOffset = document.offsetAt(e.range.end);
1434
+ if (endOffset <= lastModifiedOffset) {
1435
+ text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
1436
+ } else {
1437
+ throw new Error('Overlapping edit');
1438
+ }
1439
+ lastModifiedOffset = startOffset;
1440
+ }
1441
+ return text;
1442
+ }
1443
+ TextDocument.applyEdits = applyEdits;
1444
+ function mergeSort(data, compare) {
1445
+ if (data.length <= 1) {
1446
+ return data;
1447
+ }
1448
+ const p = data.length / 2 | 0;
1449
+ const left = data.slice(0, p);
1450
+ const right = data.slice(p);
1451
+ mergeSort(left, compare);
1452
+ mergeSort(right, compare);
1453
+ let leftIdx = 0;
1454
+ let rightIdx = 0;
1455
+ let i = 0;
1456
+ while (leftIdx < left.length && rightIdx < right.length) {
1457
+ let ret = compare(left[leftIdx], right[rightIdx]);
1458
+ if (ret <= 0) {
1459
+ data[i++] = left[leftIdx++];
1460
+ } else {
1461
+ data[i++] = right[rightIdx++];
1462
+ }
1463
+ }
1464
+ while (leftIdx < left.length) {
1465
+ data[i++] = left[leftIdx++];
1466
+ }
1467
+ while (rightIdx < right.length) {
1468
+ data[i++] = right[rightIdx++];
1469
+ }
1470
+ return data;
1471
+ }
1472
+ })(TextDocument || (TextDocument = {}));
1473
+ class FullTextDocument {
1474
+ constructor(uri, languageId, version, content) {
1475
+ this._uri = uri;
1476
+ this._languageId = languageId;
1477
+ this._version = version;
1478
+ this._content = content;
1479
+ this._lineOffsets = undefined;
1480
+ }
1481
+ get uri() {
1482
+ return this._uri;
1483
+ }
1484
+ get languageId() {
1485
+ return this._languageId;
1486
+ }
1487
+ get version() {
1488
+ return this._version;
1489
+ }
1490
+ getText(range) {
1491
+ if (range) {
1492
+ let start = this.offsetAt(range.start);
1493
+ let end = this.offsetAt(range.end);
1494
+ return this._content.substring(start, end);
1495
+ }
1496
+ return this._content;
1497
+ }
1498
+ update(event, version) {
1499
+ this._content = event.text;
1500
+ this._version = version;
1501
+ this._lineOffsets = undefined;
1502
+ }
1503
+ getLineOffsets() {
1504
+ if (this._lineOffsets === undefined) {
1505
+ let lineOffsets = [];
1506
+ let text = this._content;
1507
+ let isLineStart = true;
1508
+ for (let i = 0; i < text.length; i++) {
1509
+ if (isLineStart) {
1510
+ lineOffsets.push(i);
1511
+ isLineStart = false;
1512
+ }
1513
+ let ch = text.charAt(i);
1514
+ isLineStart = ch === '\r' || ch === '\n';
1515
+ if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
1516
+ i++;
1517
+ }
1518
+ }
1519
+ if (isLineStart && text.length > 0) {
1520
+ lineOffsets.push(text.length);
1521
+ }
1522
+ this._lineOffsets = lineOffsets;
1523
+ }
1524
+ return this._lineOffsets;
1525
+ }
1526
+ positionAt(offset) {
1527
+ offset = Math.max(Math.min(offset, this._content.length), 0);
1528
+ let lineOffsets = this.getLineOffsets();
1529
+ let low = 0,
1530
+ high = lineOffsets.length;
1531
+ if (high === 0) {
1532
+ return Position.create(0, offset);
1533
+ }
1534
+ while (low < high) {
1535
+ let mid = Math.floor((low + high) / 2);
1536
+ if (lineOffsets[mid] > offset) {
1537
+ high = mid;
1538
+ } else {
1539
+ low = mid + 1;
1540
+ }
1541
+ }
1542
+ let line = low - 1;
1543
+ return Position.create(line, offset - lineOffsets[line]);
1544
+ }
1545
+ offsetAt(position) {
1546
+ let lineOffsets = this.getLineOffsets();
1547
+ if (position.line >= lineOffsets.length) {
1548
+ return this._content.length;
1549
+ } else if (position.line < 0) {
1550
+ return 0;
1551
+ }
1552
+ let lineOffset = lineOffsets[position.line];
1553
+ let nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
1554
+ return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
1555
+ }
1556
+ get lineCount() {
1557
+ return this.getLineOffsets().length;
1558
+ }
1559
+ }
1560
+ var Is;
1561
+ (function (Is) {
1562
+ const toString = Object.prototype.toString;
1563
+ function defined(value) {
1564
+ return typeof value !== 'undefined';
1565
+ }
1566
+ Is.defined = defined;
1567
+ function undefined$1(value) {
1568
+ return typeof value === 'undefined';
1569
+ }
1570
+ Is.undefined = undefined$1;
1571
+ function boolean(value) {
1572
+ return value === true || value === false;
1573
+ }
1574
+ Is.boolean = boolean;
1575
+ function string(value) {
1576
+ return toString.call(value) === '[object String]';
1577
+ }
1578
+ Is.string = string;
1579
+ function number(value) {
1580
+ return toString.call(value) === '[object Number]';
1581
+ }
1582
+ Is.number = number;
1583
+ function numberRange(value, min, max) {
1584
+ return toString.call(value) === '[object Number]' && min <= value && value <= max;
1585
+ }
1586
+ Is.numberRange = numberRange;
1587
+ function integer(value) {
1588
+ return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;
1589
+ }
1590
+ Is.integer = integer;
1591
+ function uinteger(value) {
1592
+ return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;
1593
+ }
1594
+ Is.uinteger = uinteger;
1595
+ function func(value) {
1596
+ return toString.call(value) === '[object Function]';
1597
+ }
1598
+ Is.func = func;
1599
+ function objectLiteral(value) {
1600
+ return value !== null && typeof value === 'object';
1601
+ }
1602
+ Is.objectLiteral = objectLiteral;
1603
+ function typedArray(value, check) {
1604
+ return Array.isArray(value) && value.every(check);
1605
+ }
1606
+ Is.typedArray = typedArray;
1607
+ })(Is || (Is = {}));
1608
+ export { AnnotatedTextEdit, ChangeAnnotation, ChangeAnnotationIdentifier, CodeAction, CodeActionContext, CodeActionKind, CodeActionTriggerKind, CodeDescription, CodeLens, Color, ColorInformation, ColorPresentation, Command, CompletionItem, CompletionItemKind, CompletionItemLabelDetails, CompletionItemTag, CompletionList, CreateFile, DeleteFile, Diagnostic, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, DocumentHighlight, DocumentHighlightKind, DocumentLink, DocumentSymbol, DocumentUri, EOL, FoldingRange, FoldingRangeKind, FormattingOptions, Hover, InlayHint, InlayHintKind, InlayHintLabelPart, InlineCompletionContext, InlineCompletionItem, InlineCompletionList, InlineCompletionTriggerKind, InlineValueContext, InlineValueEvaluatableExpression, InlineValueText, InlineValueVariableLookup, InsertReplaceEdit, InsertTextFormat, InsertTextMode, Location, LocationLink, MarkedString, MarkupContent, MarkupKind, OptionalVersionedTextDocumentIdentifier, ParameterInformation, Position, Range, RenameFile, SelectedCompletionInfo, SelectionRange, SemanticTokenModifiers, SemanticTokenTypes, SemanticTokens, SignatureInformation, StringValue, SymbolInformation, SymbolKind, SymbolTag, TextDocument, TextDocumentEdit, TextDocumentIdentifier, TextDocumentItem, TextEdit, URI, VersionedTextDocumentIdentifier, WorkspaceChange, WorkspaceEdit, WorkspaceFolder, WorkspaceSymbol, integer, uinteger };