@kusto/monaco-kusto 4.1.8 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,1545 +68,1927 @@ define('vs/language/kusto/languageService/schema',["require", "exports"], functi
68
68
  };
69
69
  });
70
70
 
71
- (function (factory) {
72
- if (typeof module === "object" && typeof module.exports === "object") {
73
- var v = factory(require, exports);
74
- if (v !== undefined) module.exports = v;
75
- }
76
- else if (typeof define === "function" && define.amd) {
77
- define('vscode-languageserver-types/main',["require", "exports"], factory);
78
- }
79
- })(function (require, exports) {
80
- /* --------------------------------------------------------------------------------------------
81
- * Copyright (c) Microsoft Corporation. All rights reserved.
82
- * Licensed under the MIT License. See License.txt in the project root for license information.
83
- * ------------------------------------------------------------------------------------------ */
84
- 'use strict';
85
- Object.defineProperty(exports, "__esModule", { value: true });
86
- /**
87
- * The Position namespace provides helper functions to work with
88
- * [Position](#Position) literals.
89
- */
90
- var Position;
91
- (function (Position) {
92
- /**
93
- * Creates a new Position literal from the given line and character.
94
- * @param line The position's line.
95
- * @param character The position's character.
96
- */
97
- function create(line, character) {
98
- return { line: line, character: character };
99
- }
100
- Position.create = create;
101
- /**
102
- * Checks whether the given liternal conforms to the [Position](#Position) interface.
103
- */
104
- function is(value) {
105
- var candidate = value;
106
- return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);
107
- }
108
- Position.is = is;
109
- })(Position = exports.Position || (exports.Position = {}));
110
- /**
111
- * The Range namespace provides helper functions to work with
112
- * [Range](#Range) literals.
113
- */
114
- var Range;
115
- (function (Range) {
116
- function create(one, two, three, four) {
117
- if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) {
118
- return { start: Position.create(one, two), end: Position.create(three, four) };
119
- }
120
- else if (Position.is(one) && Position.is(two)) {
121
- return { start: one, end: two };
122
- }
123
- else {
124
- throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
125
- }
126
- }
127
- Range.create = create;
128
- /**
129
- * Checks whether the given literal conforms to the [Range](#Range) interface.
130
- */
131
- function is(value) {
132
- var candidate = value;
133
- return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
134
- }
135
- Range.is = is;
136
- })(Range = exports.Range || (exports.Range = {}));
137
- /**
138
- * The Location namespace provides helper functions to work with
139
- * [Location](#Location) literals.
140
- */
141
- var Location;
142
- (function (Location) {
143
- /**
144
- * Creates a Location literal.
145
- * @param uri The location's uri.
146
- * @param range The location's range.
147
- */
148
- function create(uri, range) {
149
- return { uri: uri, range: range };
150
- }
151
- Location.create = create;
152
- /**
153
- * Checks whether the given literal conforms to the [Location](#Location) interface.
154
- */
155
- function is(value) {
156
- var candidate = value;
157
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
158
- }
159
- Location.is = is;
160
- })(Location = exports.Location || (exports.Location = {}));
161
- /**
162
- * The LocationLink namespace provides helper functions to work with
163
- * [LocationLink](#LocationLink) literals.
164
- */
165
- var LocationLink;
166
- (function (LocationLink) {
167
- /**
168
- * Creates a LocationLink literal.
169
- * @param targetUri The definition's uri.
170
- * @param targetRange The full range of the definition.
171
- * @param targetSelectionRange The span of the symbol definition at the target.
172
- * @param originSelectionRange The span of the symbol being defined in the originating source file.
173
- */
174
- function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
175
- return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
176
- }
177
- LocationLink.create = create;
178
- /**
179
- * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.
180
- */
181
- function is(value) {
182
- var candidate = value;
183
- return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
184
- && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))
185
- && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
186
- }
187
- LocationLink.is = is;
188
- })(LocationLink = exports.LocationLink || (exports.LocationLink = {}));
189
- /**
190
- * The Color namespace provides helper functions to work with
191
- * [Color](#Color) literals.
192
- */
193
- var Color;
194
- (function (Color) {
195
- /**
196
- * Creates a new Color literal.
197
- */
198
- function create(red, green, blue, alpha) {
199
- return {
200
- red: red,
201
- green: green,
202
- blue: blue,
203
- alpha: alpha,
204
- };
205
- }
206
- Color.create = create;
207
- /**
208
- * Checks whether the given literal conforms to the [Color](#Color) interface.
209
- */
210
- function is(value) {
211
- var candidate = value;
212
- return Is.number(candidate.red)
213
- && Is.number(candidate.green)
214
- && Is.number(candidate.blue)
215
- && Is.number(candidate.alpha);
216
- }
217
- Color.is = is;
218
- })(Color = exports.Color || (exports.Color = {}));
219
- /**
220
- * The ColorInformation namespace provides helper functions to work with
221
- * [ColorInformation](#ColorInformation) literals.
222
- */
223
- var ColorInformation;
224
- (function (ColorInformation) {
225
- /**
226
- * Creates a new ColorInformation literal.
227
- */
228
- function create(range, color) {
229
- return {
230
- range: range,
231
- color: color,
232
- };
233
- }
234
- ColorInformation.create = create;
235
- /**
236
- * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.
237
- */
238
- function is(value) {
239
- var candidate = value;
240
- return Range.is(candidate.range) && Color.is(candidate.color);
241
- }
242
- ColorInformation.is = is;
243
- })(ColorInformation = exports.ColorInformation || (exports.ColorInformation = {}));
244
- /**
245
- * The Color namespace provides helper functions to work with
246
- * [ColorPresentation](#ColorPresentation) literals.
247
- */
248
- var ColorPresentation;
249
- (function (ColorPresentation) {
250
- /**
251
- * Creates a new ColorInformation literal.
252
- */
253
- function create(label, textEdit, additionalTextEdits) {
254
- return {
255
- label: label,
256
- textEdit: textEdit,
257
- additionalTextEdits: additionalTextEdits,
258
- };
259
- }
260
- ColorPresentation.create = create;
261
- /**
262
- * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.
263
- */
264
- function is(value) {
265
- var candidate = value;
266
- return Is.string(candidate.label)
267
- && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
268
- && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
269
- }
270
- ColorPresentation.is = is;
271
- })(ColorPresentation = exports.ColorPresentation || (exports.ColorPresentation = {}));
272
- /**
273
- * Enum of known range kinds
274
- */
275
- var FoldingRangeKind;
276
- (function (FoldingRangeKind) {
277
- /**
278
- * Folding range for a comment
279
- */
280
- FoldingRangeKind["Comment"] = "comment";
281
- /**
282
- * Folding range for a imports or includes
283
- */
284
- FoldingRangeKind["Imports"] = "imports";
285
- /**
286
- * Folding range for a region (e.g. `#region`)
287
- */
288
- FoldingRangeKind["Region"] = "region";
289
- })(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));
290
- /**
291
- * The folding range namespace provides helper functions to work with
292
- * [FoldingRange](#FoldingRange) literals.
293
- */
294
- var FoldingRange;
295
- (function (FoldingRange) {
296
- /**
297
- * Creates a new FoldingRange literal.
298
- */
299
- function create(startLine, endLine, startCharacter, endCharacter, kind) {
300
- var result = {
301
- startLine: startLine,
302
- endLine: endLine
303
- };
304
- if (Is.defined(startCharacter)) {
305
- result.startCharacter = startCharacter;
306
- }
307
- if (Is.defined(endCharacter)) {
308
- result.endCharacter = endCharacter;
309
- }
310
- if (Is.defined(kind)) {
311
- result.kind = kind;
312
- }
313
- return result;
314
- }
315
- FoldingRange.create = create;
316
- /**
317
- * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.
318
- */
319
- function is(value) {
320
- var candidate = value;
321
- return Is.number(candidate.startLine) && Is.number(candidate.startLine)
322
- && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter))
323
- && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter))
324
- && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
325
- }
326
- FoldingRange.is = is;
327
- })(FoldingRange = exports.FoldingRange || (exports.FoldingRange = {}));
328
- /**
329
- * The DiagnosticRelatedInformation namespace provides helper functions to work with
330
- * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.
331
- */
332
- var DiagnosticRelatedInformation;
333
- (function (DiagnosticRelatedInformation) {
334
- /**
335
- * Creates a new DiagnosticRelatedInformation literal.
336
- */
337
- function create(location, message) {
338
- return {
339
- location: location,
340
- message: message
341
- };
342
- }
343
- DiagnosticRelatedInformation.create = create;
344
- /**
345
- * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.
346
- */
347
- function is(value) {
348
- var candidate = value;
349
- return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
350
- }
351
- DiagnosticRelatedInformation.is = is;
352
- })(DiagnosticRelatedInformation = exports.DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = {}));
353
- /**
354
- * The diagnostic's severity.
355
- */
356
- var DiagnosticSeverity;
357
- (function (DiagnosticSeverity) {
358
- /**
359
- * Reports an error.
360
- */
361
- DiagnosticSeverity.Error = 1;
362
- /**
363
- * Reports a warning.
364
- */
365
- DiagnosticSeverity.Warning = 2;
366
- /**
367
- * Reports an information.
368
- */
369
- DiagnosticSeverity.Information = 3;
370
- /**
371
- * Reports a hint.
372
- */
373
- DiagnosticSeverity.Hint = 4;
374
- })(DiagnosticSeverity = exports.DiagnosticSeverity || (exports.DiagnosticSeverity = {}));
375
- /**
376
- * The diagnostic tags.
377
- *
378
- * @since 3.15.0
379
- */
380
- var DiagnosticTag;
381
- (function (DiagnosticTag) {
382
- /**
383
- * Unused or unnecessary code.
384
- *
385
- * Clients are allowed to render diagnostics with this tag faded out instead of having
386
- * an error squiggle.
387
- */
388
- DiagnosticTag.Unnecessary = 1;
389
- /**
390
- * Deprecated or obsolete code.
391
- *
392
- * Clients are allowed to rendered diagnostics with this tag strike through.
393
- */
394
- DiagnosticTag.Deprecated = 2;
395
- })(DiagnosticTag = exports.DiagnosticTag || (exports.DiagnosticTag = {}));
396
- /**
397
- * The Diagnostic namespace provides helper functions to work with
398
- * [Diagnostic](#Diagnostic) literals.
399
- */
400
- var Diagnostic;
401
- (function (Diagnostic) {
402
- /**
403
- * Creates a new Diagnostic literal.
404
- */
405
- function create(range, message, severity, code, source, relatedInformation) {
406
- var result = { range: range, message: message };
407
- if (Is.defined(severity)) {
408
- result.severity = severity;
409
- }
410
- if (Is.defined(code)) {
411
- result.code = code;
412
- }
413
- if (Is.defined(source)) {
414
- result.source = source;
415
- }
416
- if (Is.defined(relatedInformation)) {
417
- result.relatedInformation = relatedInformation;
418
- }
419
- return result;
420
- }
421
- Diagnostic.create = create;
422
- /**
423
- * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.
424
- */
425
- function is(value) {
426
- var candidate = value;
427
- return Is.defined(candidate)
428
- && Range.is(candidate.range)
429
- && Is.string(candidate.message)
430
- && (Is.number(candidate.severity) || Is.undefined(candidate.severity))
431
- && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
432
- && (Is.string(candidate.source) || Is.undefined(candidate.source))
433
- && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
434
- }
435
- Diagnostic.is = is;
436
- })(Diagnostic = exports.Diagnostic || (exports.Diagnostic = {}));
437
- /**
438
- * The Command namespace provides helper functions to work with
439
- * [Command](#Command) literals.
440
- */
441
- var Command;
442
- (function (Command) {
443
- /**
444
- * Creates a new Command literal.
445
- */
446
- function create(title, command) {
447
- var args = [];
448
- for (var _i = 2; _i < arguments.length; _i++) {
449
- args[_i - 2] = arguments[_i];
450
- }
451
- var result = { title: title, command: command };
452
- if (Is.defined(args) && args.length > 0) {
453
- result.arguments = args;
454
- }
455
- return result;
456
- }
457
- Command.create = create;
458
- /**
459
- * Checks whether the given literal conforms to the [Command](#Command) interface.
460
- */
461
- function is(value) {
462
- var candidate = value;
463
- return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
464
- }
465
- Command.is = is;
466
- })(Command = exports.Command || (exports.Command = {}));
467
- /**
468
- * The TextEdit namespace provides helper function to create replace,
469
- * insert and delete edits more easily.
470
- */
471
- var TextEdit;
472
- (function (TextEdit) {
473
- /**
474
- * Creates a replace text edit.
475
- * @param range The range of text to be replaced.
476
- * @param newText The new text.
477
- */
478
- function replace(range, newText) {
479
- return { range: range, newText: newText };
480
- }
481
- TextEdit.replace = replace;
482
- /**
483
- * Creates a insert text edit.
484
- * @param position The position to insert the text at.
485
- * @param newText The text to be inserted.
486
- */
487
- function insert(position, newText) {
488
- return { range: { start: position, end: position }, newText: newText };
489
- }
490
- TextEdit.insert = insert;
491
- /**
492
- * Creates a delete text edit.
493
- * @param range The range of text to be deleted.
494
- */
495
- function del(range) {
496
- return { range: range, newText: '' };
497
- }
498
- TextEdit.del = del;
499
- function is(value) {
500
- var candidate = value;
501
- return Is.objectLiteral(candidate)
502
- && Is.string(candidate.newText)
503
- && Range.is(candidate.range);
504
- }
505
- TextEdit.is = is;
506
- })(TextEdit = exports.TextEdit || (exports.TextEdit = {}));
507
- /**
508
- * The TextDocumentEdit namespace provides helper function to create
509
- * an edit that manipulates a text document.
510
- */
511
- var TextDocumentEdit;
512
- (function (TextDocumentEdit) {
513
- /**
514
- * Creates a new `TextDocumentEdit`
515
- */
516
- function create(textDocument, edits) {
517
- return { textDocument: textDocument, edits: edits };
518
- }
519
- TextDocumentEdit.create = create;
520
- function is(value) {
521
- var candidate = value;
522
- return Is.defined(candidate)
523
- && VersionedTextDocumentIdentifier.is(candidate.textDocument)
524
- && Array.isArray(candidate.edits);
525
- }
526
- TextDocumentEdit.is = is;
527
- })(TextDocumentEdit = exports.TextDocumentEdit || (exports.TextDocumentEdit = {}));
528
- var CreateFile;
529
- (function (CreateFile) {
530
- function create(uri, options) {
531
- var result = {
532
- kind: 'create',
533
- uri: uri
534
- };
535
- if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
536
- result.options = options;
537
- }
538
- return result;
539
- }
540
- CreateFile.create = create;
541
- function is(value) {
542
- var candidate = value;
543
- return candidate && candidate.kind === 'create' && Is.string(candidate.uri) &&
544
- (candidate.options === void 0 ||
545
- ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));
546
- }
547
- CreateFile.is = is;
548
- })(CreateFile = exports.CreateFile || (exports.CreateFile = {}));
549
- var RenameFile;
550
- (function (RenameFile) {
551
- function create(oldUri, newUri, options) {
552
- var result = {
553
- kind: 'rename',
554
- oldUri: oldUri,
555
- newUri: newUri
556
- };
557
- if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
558
- result.options = options;
559
- }
560
- return result;
561
- }
562
- RenameFile.create = create;
563
- function is(value) {
564
- var candidate = value;
565
- return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) &&
566
- (candidate.options === void 0 ||
567
- ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));
568
- }
569
- RenameFile.is = is;
570
- })(RenameFile = exports.RenameFile || (exports.RenameFile = {}));
571
- var DeleteFile;
572
- (function (DeleteFile) {
573
- function create(uri, options) {
574
- var result = {
575
- kind: 'delete',
576
- uri: uri
577
- };
578
- if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
579
- result.options = options;
580
- }
581
- return result;
582
- }
583
- DeleteFile.create = create;
584
- function is(value) {
585
- var candidate = value;
586
- return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) &&
587
- (candidate.options === void 0 ||
588
- ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))));
589
- }
590
- DeleteFile.is = is;
591
- })(DeleteFile = exports.DeleteFile || (exports.DeleteFile = {}));
592
- var WorkspaceEdit;
593
- (function (WorkspaceEdit) {
594
- function is(value) {
595
- var candidate = value;
596
- return candidate &&
597
- (candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&
598
- (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) {
599
- if (Is.string(change.kind)) {
600
- return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
601
- }
602
- else {
603
- return TextDocumentEdit.is(change);
604
- }
605
- }));
606
- }
607
- WorkspaceEdit.is = is;
608
- })(WorkspaceEdit = exports.WorkspaceEdit || (exports.WorkspaceEdit = {}));
609
- var TextEditChangeImpl = /** @class */ (function () {
610
- function TextEditChangeImpl(edits) {
611
- this.edits = edits;
612
- }
613
- TextEditChangeImpl.prototype.insert = function (position, newText) {
614
- this.edits.push(TextEdit.insert(position, newText));
615
- };
616
- TextEditChangeImpl.prototype.replace = function (range, newText) {
617
- this.edits.push(TextEdit.replace(range, newText));
618
- };
619
- TextEditChangeImpl.prototype.delete = function (range) {
620
- this.edits.push(TextEdit.del(range));
621
- };
622
- TextEditChangeImpl.prototype.add = function (edit) {
623
- this.edits.push(edit);
624
- };
625
- TextEditChangeImpl.prototype.all = function () {
626
- return this.edits;
627
- };
628
- TextEditChangeImpl.prototype.clear = function () {
629
- this.edits.splice(0, this.edits.length);
630
- };
631
- return TextEditChangeImpl;
632
- }());
633
- /**
634
- * A workspace change helps constructing changes to a workspace.
635
- */
636
- var WorkspaceChange = /** @class */ (function () {
637
- function WorkspaceChange(workspaceEdit) {
638
- var _this = this;
639
- this._textEditChanges = Object.create(null);
640
- if (workspaceEdit) {
641
- this._workspaceEdit = workspaceEdit;
642
- if (workspaceEdit.documentChanges) {
643
- workspaceEdit.documentChanges.forEach(function (change) {
644
- if (TextDocumentEdit.is(change)) {
645
- var textEditChange = new TextEditChangeImpl(change.edits);
646
- _this._textEditChanges[change.textDocument.uri] = textEditChange;
647
- }
648
- });
649
- }
650
- else if (workspaceEdit.changes) {
651
- Object.keys(workspaceEdit.changes).forEach(function (key) {
652
- var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
653
- _this._textEditChanges[key] = textEditChange;
654
- });
655
- }
656
- }
657
- }
658
- Object.defineProperty(WorkspaceChange.prototype, "edit", {
659
- /**
660
- * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal
661
- * use to be returned from a workspace edit operation like rename.
662
- */
663
- get: function () {
664
- return this._workspaceEdit;
665
- },
666
- enumerable: true,
667
- configurable: true
668
- });
669
- WorkspaceChange.prototype.getTextEditChange = function (key) {
670
- if (VersionedTextDocumentIdentifier.is(key)) {
671
- if (!this._workspaceEdit) {
672
- this._workspaceEdit = {
673
- documentChanges: []
674
- };
675
- }
676
- if (!this._workspaceEdit.documentChanges) {
677
- throw new Error('Workspace edit is not configured for document changes.');
678
- }
679
- var textDocument = key;
680
- var result = this._textEditChanges[textDocument.uri];
681
- if (!result) {
682
- var edits = [];
683
- var textDocumentEdit = {
684
- textDocument: textDocument,
685
- edits: edits
686
- };
687
- this._workspaceEdit.documentChanges.push(textDocumentEdit);
688
- result = new TextEditChangeImpl(edits);
689
- this._textEditChanges[textDocument.uri] = result;
690
- }
691
- return result;
692
- }
693
- else {
694
- if (!this._workspaceEdit) {
695
- this._workspaceEdit = {
696
- changes: Object.create(null)
697
- };
698
- }
699
- if (!this._workspaceEdit.changes) {
700
- throw new Error('Workspace edit is not configured for normal text edit changes.');
701
- }
702
- var result = this._textEditChanges[key];
703
- if (!result) {
704
- var edits = [];
705
- this._workspaceEdit.changes[key] = edits;
706
- result = new TextEditChangeImpl(edits);
707
- this._textEditChanges[key] = result;
708
- }
709
- return result;
710
- }
711
- };
712
- WorkspaceChange.prototype.createFile = function (uri, options) {
713
- this.checkDocumentChanges();
714
- this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options));
715
- };
716
- WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) {
717
- this.checkDocumentChanges();
718
- this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options));
719
- };
720
- WorkspaceChange.prototype.deleteFile = function (uri, options) {
721
- this.checkDocumentChanges();
722
- this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options));
723
- };
724
- WorkspaceChange.prototype.checkDocumentChanges = function () {
725
- if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) {
726
- throw new Error('Workspace edit is not configured for document changes.');
727
- }
728
- };
729
- return WorkspaceChange;
730
- }());
731
- exports.WorkspaceChange = WorkspaceChange;
732
- /**
733
- * The TextDocumentIdentifier namespace provides helper functions to work with
734
- * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.
735
- */
736
- var TextDocumentIdentifier;
737
- (function (TextDocumentIdentifier) {
738
- /**
739
- * Creates a new TextDocumentIdentifier literal.
740
- * @param uri The document's uri.
741
- */
742
- function create(uri) {
743
- return { uri: uri };
744
- }
745
- TextDocumentIdentifier.create = create;
746
- /**
747
- * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.
748
- */
749
- function is(value) {
750
- var candidate = value;
751
- return Is.defined(candidate) && Is.string(candidate.uri);
752
- }
753
- TextDocumentIdentifier.is = is;
754
- })(TextDocumentIdentifier = exports.TextDocumentIdentifier || (exports.TextDocumentIdentifier = {}));
755
- /**
756
- * The VersionedTextDocumentIdentifier namespace provides helper functions to work with
757
- * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.
758
- */
759
- var VersionedTextDocumentIdentifier;
760
- (function (VersionedTextDocumentIdentifier) {
761
- /**
762
- * Creates a new VersionedTextDocumentIdentifier literal.
763
- * @param uri The document's uri.
764
- * @param uri The document's text.
765
- */
766
- function create(uri, version) {
767
- return { uri: uri, version: version };
768
- }
769
- VersionedTextDocumentIdentifier.create = create;
770
- /**
771
- * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.
772
- */
773
- function is(value) {
774
- var candidate = value;
775
- return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));
776
- }
777
- VersionedTextDocumentIdentifier.is = is;
778
- })(VersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = {}));
779
- /**
780
- * The TextDocumentItem namespace provides helper functions to work with
781
- * [TextDocumentItem](#TextDocumentItem) literals.
782
- */
783
- var TextDocumentItem;
784
- (function (TextDocumentItem) {
785
- /**
786
- * Creates a new TextDocumentItem literal.
787
- * @param uri The document's uri.
788
- * @param languageId The document's language identifier.
789
- * @param version The document's version number.
790
- * @param text The document's text.
791
- */
792
- function create(uri, languageId, version, text) {
793
- return { uri: uri, languageId: languageId, version: version, text: text };
794
- }
795
- TextDocumentItem.create = create;
796
- /**
797
- * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.
798
- */
799
- function is(value) {
800
- var candidate = value;
801
- return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text);
802
- }
803
- TextDocumentItem.is = is;
804
- })(TextDocumentItem = exports.TextDocumentItem || (exports.TextDocumentItem = {}));
805
- /**
806
- * Describes the content type that a client supports in various
807
- * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
808
- *
809
- * Please note that `MarkupKinds` must not start with a `$`. This kinds
810
- * are reserved for internal usage.
811
- */
812
- var MarkupKind;
813
- (function (MarkupKind) {
814
- /**
815
- * Plain text is supported as a content format
816
- */
817
- MarkupKind.PlainText = 'plaintext';
818
- /**
819
- * Markdown is supported as a content format
820
- */
821
- MarkupKind.Markdown = 'markdown';
822
- })(MarkupKind = exports.MarkupKind || (exports.MarkupKind = {}));
823
- (function (MarkupKind) {
824
- /**
825
- * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.
826
- */
827
- function is(value) {
828
- var candidate = value;
829
- return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
830
- }
831
- MarkupKind.is = is;
832
- })(MarkupKind = exports.MarkupKind || (exports.MarkupKind = {}));
833
- var MarkupContent;
834
- (function (MarkupContent) {
835
- /**
836
- * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.
837
- */
838
- function is(value) {
839
- var candidate = value;
840
- return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
841
- }
842
- MarkupContent.is = is;
843
- })(MarkupContent = exports.MarkupContent || (exports.MarkupContent = {}));
844
- /**
845
- * The kind of a completion entry.
846
- */
847
- var CompletionItemKind;
848
- (function (CompletionItemKind) {
849
- CompletionItemKind.Text = 1;
850
- CompletionItemKind.Method = 2;
851
- CompletionItemKind.Function = 3;
852
- CompletionItemKind.Constructor = 4;
853
- CompletionItemKind.Field = 5;
854
- CompletionItemKind.Variable = 6;
855
- CompletionItemKind.Class = 7;
856
- CompletionItemKind.Interface = 8;
857
- CompletionItemKind.Module = 9;
858
- CompletionItemKind.Property = 10;
859
- CompletionItemKind.Unit = 11;
860
- CompletionItemKind.Value = 12;
861
- CompletionItemKind.Enum = 13;
862
- CompletionItemKind.Keyword = 14;
863
- CompletionItemKind.Snippet = 15;
864
- CompletionItemKind.Color = 16;
865
- CompletionItemKind.File = 17;
866
- CompletionItemKind.Reference = 18;
867
- CompletionItemKind.Folder = 19;
868
- CompletionItemKind.EnumMember = 20;
869
- CompletionItemKind.Constant = 21;
870
- CompletionItemKind.Struct = 22;
871
- CompletionItemKind.Event = 23;
872
- CompletionItemKind.Operator = 24;
873
- CompletionItemKind.TypeParameter = 25;
874
- })(CompletionItemKind = exports.CompletionItemKind || (exports.CompletionItemKind = {}));
875
- /**
876
- * Defines whether the insert text in a completion item should be interpreted as
877
- * plain text or a snippet.
878
- */
879
- var InsertTextFormat;
880
- (function (InsertTextFormat) {
881
- /**
882
- * The primary text to be inserted is treated as a plain string.
883
- */
884
- InsertTextFormat.PlainText = 1;
885
- /**
886
- * The primary text to be inserted is treated as a snippet.
887
- *
888
- * A snippet can define tab stops and placeholders with `$1`, `$2`
889
- * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
890
- * the end of the snippet. Placeholders with equal identifiers are linked,
891
- * that is typing in one will update others too.
892
- *
893
- * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md
894
- */
895
- InsertTextFormat.Snippet = 2;
896
- })(InsertTextFormat = exports.InsertTextFormat || (exports.InsertTextFormat = {}));
897
- /**
898
- * Completion item tags are extra annotations that tweak the rendering of a completion
899
- * item.
900
- *
901
- * @since 3.15.0
902
- */
903
- var CompletionItemTag;
904
- (function (CompletionItemTag) {
905
- /**
906
- * Render a completion as obsolete, usually using a strike-out.
907
- */
908
- CompletionItemTag.Deprecated = 1;
909
- })(CompletionItemTag = exports.CompletionItemTag || (exports.CompletionItemTag = {}));
910
- /**
911
- * The CompletionItem namespace provides functions to deal with
912
- * completion items.
913
- */
914
- var CompletionItem;
915
- (function (CompletionItem) {
916
- /**
917
- * Create a completion item and seed it with a label.
918
- * @param label The completion item's label
919
- */
920
- function create(label) {
921
- return { label: label };
922
- }
923
- CompletionItem.create = create;
924
- })(CompletionItem = exports.CompletionItem || (exports.CompletionItem = {}));
925
- /**
926
- * The CompletionList namespace provides functions to deal with
927
- * completion lists.
928
- */
929
- var CompletionList;
930
- (function (CompletionList) {
931
- /**
932
- * Creates a new completion list.
933
- *
934
- * @param items The completion items.
935
- * @param isIncomplete The list is not complete.
936
- */
937
- function create(items, isIncomplete) {
938
- return { items: items ? items : [], isIncomplete: !!isIncomplete };
939
- }
940
- CompletionList.create = create;
941
- })(CompletionList = exports.CompletionList || (exports.CompletionList = {}));
942
- var MarkedString;
943
- (function (MarkedString) {
944
- /**
945
- * Creates a marked string from plain text.
946
- *
947
- * @param plainText The plain text.
948
- */
949
- function fromPlainText(plainText) {
950
- return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
951
- }
952
- MarkedString.fromPlainText = fromPlainText;
953
- /**
954
- * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.
955
- */
956
- function is(value) {
957
- var candidate = value;
958
- return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
959
- }
960
- MarkedString.is = is;
961
- })(MarkedString = exports.MarkedString || (exports.MarkedString = {}));
962
- var Hover;
963
- (function (Hover) {
964
- /**
965
- * Checks whether the given value conforms to the [Hover](#Hover) interface.
966
- */
967
- function is(value) {
968
- var candidate = value;
969
- return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
970
- MarkedString.is(candidate.contents) ||
971
- Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
972
- }
973
- Hover.is = is;
974
- })(Hover = exports.Hover || (exports.Hover = {}));
975
- /**
976
- * The ParameterInformation namespace provides helper functions to work with
977
- * [ParameterInformation](#ParameterInformation) literals.
978
- */
979
- var ParameterInformation;
980
- (function (ParameterInformation) {
981
- /**
982
- * Creates a new parameter information literal.
983
- *
984
- * @param label A label string.
985
- * @param documentation A doc string.
986
- */
987
- function create(label, documentation) {
988
- return documentation ? { label: label, documentation: documentation } : { label: label };
989
- }
990
- ParameterInformation.create = create;
991
- })(ParameterInformation = exports.ParameterInformation || (exports.ParameterInformation = {}));
992
- /**
993
- * The SignatureInformation namespace provides helper functions to work with
994
- * [SignatureInformation](#SignatureInformation) literals.
995
- */
996
- var SignatureInformation;
997
- (function (SignatureInformation) {
998
- function create(label, documentation) {
999
- var parameters = [];
1000
- for (var _i = 2; _i < arguments.length; _i++) {
1001
- parameters[_i - 2] = arguments[_i];
1002
- }
1003
- var result = { label: label };
1004
- if (Is.defined(documentation)) {
1005
- result.documentation = documentation;
1006
- }
1007
- if (Is.defined(parameters)) {
1008
- result.parameters = parameters;
1009
- }
1010
- else {
1011
- result.parameters = [];
1012
- }
1013
- return result;
1014
- }
1015
- SignatureInformation.create = create;
1016
- })(SignatureInformation = exports.SignatureInformation || (exports.SignatureInformation = {}));
1017
- /**
1018
- * A document highlight kind.
1019
- */
1020
- var DocumentHighlightKind;
1021
- (function (DocumentHighlightKind) {
1022
- /**
1023
- * A textual occurrence.
1024
- */
1025
- DocumentHighlightKind.Text = 1;
1026
- /**
1027
- * Read-access of a symbol, like reading a variable.
1028
- */
1029
- DocumentHighlightKind.Read = 2;
1030
- /**
1031
- * Write-access of a symbol, like writing to a variable.
1032
- */
1033
- DocumentHighlightKind.Write = 3;
1034
- })(DocumentHighlightKind = exports.DocumentHighlightKind || (exports.DocumentHighlightKind = {}));
1035
- /**
1036
- * DocumentHighlight namespace to provide helper functions to work with
1037
- * [DocumentHighlight](#DocumentHighlight) literals.
1038
- */
1039
- var DocumentHighlight;
1040
- (function (DocumentHighlight) {
1041
- /**
1042
- * Create a DocumentHighlight object.
1043
- * @param range The range the highlight applies to.
1044
- */
1045
- function create(range, kind) {
1046
- var result = { range: range };
1047
- if (Is.number(kind)) {
1048
- result.kind = kind;
1049
- }
1050
- return result;
1051
- }
1052
- DocumentHighlight.create = create;
1053
- })(DocumentHighlight = exports.DocumentHighlight || (exports.DocumentHighlight = {}));
1054
- /**
1055
- * A symbol kind.
1056
- */
1057
- var SymbolKind;
1058
- (function (SymbolKind) {
1059
- SymbolKind.File = 1;
1060
- SymbolKind.Module = 2;
1061
- SymbolKind.Namespace = 3;
1062
- SymbolKind.Package = 4;
1063
- SymbolKind.Class = 5;
1064
- SymbolKind.Method = 6;
1065
- SymbolKind.Property = 7;
1066
- SymbolKind.Field = 8;
1067
- SymbolKind.Constructor = 9;
1068
- SymbolKind.Enum = 10;
1069
- SymbolKind.Interface = 11;
1070
- SymbolKind.Function = 12;
1071
- SymbolKind.Variable = 13;
1072
- SymbolKind.Constant = 14;
1073
- SymbolKind.String = 15;
1074
- SymbolKind.Number = 16;
1075
- SymbolKind.Boolean = 17;
1076
- SymbolKind.Array = 18;
1077
- SymbolKind.Object = 19;
1078
- SymbolKind.Key = 20;
1079
- SymbolKind.Null = 21;
1080
- SymbolKind.EnumMember = 22;
1081
- SymbolKind.Struct = 23;
1082
- SymbolKind.Event = 24;
1083
- SymbolKind.Operator = 25;
1084
- SymbolKind.TypeParameter = 26;
1085
- })(SymbolKind = exports.SymbolKind || (exports.SymbolKind = {}));
1086
- /**
1087
- * Symbol tags are extra annotations that tweak the rendering of a symbol.
1088
- * @since 3.15
1089
- */
1090
- var SymbolTag;
1091
- (function (SymbolTag) {
1092
- /**
1093
- * Render a symbol as obsolete, usually using a strike-out.
1094
- */
1095
- SymbolTag.Deprecated = 1;
1096
- })(SymbolTag = exports.SymbolTag || (exports.SymbolTag = {}));
1097
- var SymbolInformation;
1098
- (function (SymbolInformation) {
1099
- /**
1100
- * Creates a new symbol information literal.
1101
- *
1102
- * @param name The name of the symbol.
1103
- * @param kind The kind of the symbol.
1104
- * @param range The range of the location of the symbol.
1105
- * @param uri The resource of the location of symbol, defaults to the current document.
1106
- * @param containerName The name of the symbol containing the symbol.
1107
- */
1108
- function create(name, kind, range, uri, containerName) {
1109
- var result = {
1110
- name: name,
1111
- kind: kind,
1112
- location: { uri: uri, range: range }
1113
- };
1114
- if (containerName) {
1115
- result.containerName = containerName;
1116
- }
1117
- return result;
1118
- }
1119
- SymbolInformation.create = create;
1120
- })(SymbolInformation = exports.SymbolInformation || (exports.SymbolInformation = {}));
1121
- var DocumentSymbol;
1122
- (function (DocumentSymbol) {
1123
- /**
1124
- * Creates a new symbol information literal.
1125
- *
1126
- * @param name The name of the symbol.
1127
- * @param detail The detail of the symbol.
1128
- * @param kind The kind of the symbol.
1129
- * @param range The range of the symbol.
1130
- * @param selectionRange The selectionRange of the symbol.
1131
- * @param children Children of the symbol.
1132
- */
1133
- function create(name, detail, kind, range, selectionRange, children) {
1134
- var result = {
1135
- name: name,
1136
- detail: detail,
1137
- kind: kind,
1138
- range: range,
1139
- selectionRange: selectionRange
1140
- };
1141
- if (children !== void 0) {
1142
- result.children = children;
1143
- }
1144
- return result;
1145
- }
1146
- DocumentSymbol.create = create;
1147
- /**
1148
- * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.
1149
- */
1150
- function is(value) {
1151
- var candidate = value;
1152
- return candidate &&
1153
- Is.string(candidate.name) && Is.number(candidate.kind) &&
1154
- Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
1155
- (candidate.detail === void 0 || Is.string(candidate.detail)) &&
1156
- (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) &&
1157
- (candidate.children === void 0 || Array.isArray(candidate.children));
1158
- }
1159
- DocumentSymbol.is = is;
1160
- })(DocumentSymbol = exports.DocumentSymbol || (exports.DocumentSymbol = {}));
1161
- /**
1162
- * A set of predefined code action kinds
1163
- */
1164
- var CodeActionKind;
1165
- (function (CodeActionKind) {
1166
- /**
1167
- * Empty kind.
1168
- */
1169
- CodeActionKind.Empty = '';
1170
- /**
1171
- * Base kind for quickfix actions: 'quickfix'
1172
- */
1173
- CodeActionKind.QuickFix = 'quickfix';
1174
- /**
1175
- * Base kind for refactoring actions: 'refactor'
1176
- */
1177
- CodeActionKind.Refactor = 'refactor';
1178
- /**
1179
- * Base kind for refactoring extraction actions: 'refactor.extract'
1180
- *
1181
- * Example extract actions:
1182
- *
1183
- * - Extract method
1184
- * - Extract function
1185
- * - Extract variable
1186
- * - Extract interface from class
1187
- * - ...
1188
- */
1189
- CodeActionKind.RefactorExtract = 'refactor.extract';
1190
- /**
1191
- * Base kind for refactoring inline actions: 'refactor.inline'
1192
- *
1193
- * Example inline actions:
1194
- *
1195
- * - Inline function
1196
- * - Inline variable
1197
- * - Inline constant
1198
- * - ...
1199
- */
1200
- CodeActionKind.RefactorInline = 'refactor.inline';
1201
- /**
1202
- * Base kind for refactoring rewrite actions: 'refactor.rewrite'
1203
- *
1204
- * Example rewrite actions:
1205
- *
1206
- * - Convert JavaScript function to class
1207
- * - Add or remove parameter
1208
- * - Encapsulate field
1209
- * - Make method static
1210
- * - Move method to base class
1211
- * - ...
1212
- */
1213
- CodeActionKind.RefactorRewrite = 'refactor.rewrite';
1214
- /**
1215
- * Base kind for source actions: `source`
1216
- *
1217
- * Source code actions apply to the entire file.
1218
- */
1219
- CodeActionKind.Source = 'source';
1220
- /**
1221
- * Base kind for an organize imports source action: `source.organizeImports`
1222
- */
1223
- CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
1224
- /**
1225
- * Base kind for auto-fix source actions: `source.fixAll`.
1226
- *
1227
- * Fix all actions automatically fix errors that have a clear fix that do not require user input.
1228
- * They should not suppress errors or perform unsafe fixes such as generating new types or classes.
1229
- *
1230
- * @since 3.15.0
1231
- */
1232
- CodeActionKind.SourceFixAll = 'source.fixAll';
1233
- })(CodeActionKind = exports.CodeActionKind || (exports.CodeActionKind = {}));
1234
- /**
1235
- * The CodeActionContext namespace provides helper functions to work with
1236
- * [CodeActionContext](#CodeActionContext) literals.
1237
- */
1238
- var CodeActionContext;
1239
- (function (CodeActionContext) {
1240
- /**
1241
- * Creates a new CodeActionContext literal.
1242
- */
1243
- function create(diagnostics, only) {
1244
- var result = { diagnostics: diagnostics };
1245
- if (only !== void 0 && only !== null) {
1246
- result.only = only;
1247
- }
1248
- return result;
1249
- }
1250
- CodeActionContext.create = create;
1251
- /**
1252
- * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.
1253
- */
1254
- function is(value) {
1255
- var candidate = value;
1256
- return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));
1257
- }
1258
- CodeActionContext.is = is;
1259
- })(CodeActionContext = exports.CodeActionContext || (exports.CodeActionContext = {}));
1260
- var CodeAction;
1261
- (function (CodeAction) {
1262
- function create(title, commandOrEdit, kind) {
1263
- var result = { title: title };
1264
- if (Command.is(commandOrEdit)) {
1265
- result.command = commandOrEdit;
1266
- }
1267
- else {
1268
- result.edit = commandOrEdit;
1269
- }
1270
- if (kind !== void 0) {
1271
- result.kind = kind;
1272
- }
1273
- return result;
1274
- }
1275
- CodeAction.create = create;
1276
- function is(value) {
1277
- var candidate = value;
1278
- return candidate && Is.string(candidate.title) &&
1279
- (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
1280
- (candidate.kind === void 0 || Is.string(candidate.kind)) &&
1281
- (candidate.edit !== void 0 || candidate.command !== void 0) &&
1282
- (candidate.command === void 0 || Command.is(candidate.command)) &&
1283
- (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) &&
1284
- (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
1285
- }
1286
- CodeAction.is = is;
1287
- })(CodeAction = exports.CodeAction || (exports.CodeAction = {}));
1288
- /**
1289
- * The CodeLens namespace provides helper functions to work with
1290
- * [CodeLens](#CodeLens) literals.
1291
- */
1292
- var CodeLens;
1293
- (function (CodeLens) {
1294
- /**
1295
- * Creates a new CodeLens literal.
1296
- */
1297
- function create(range, data) {
1298
- var result = { range: range };
1299
- if (Is.defined(data)) {
1300
- result.data = data;
1301
- }
1302
- return result;
1303
- }
1304
- CodeLens.create = create;
1305
- /**
1306
- * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.
1307
- */
1308
- function is(value) {
1309
- var candidate = value;
1310
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
1311
- }
1312
- CodeLens.is = is;
1313
- })(CodeLens = exports.CodeLens || (exports.CodeLens = {}));
1314
- /**
1315
- * The FormattingOptions namespace provides helper functions to work with
1316
- * [FormattingOptions](#FormattingOptions) literals.
1317
- */
1318
- var FormattingOptions;
1319
- (function (FormattingOptions) {
1320
- /**
1321
- * Creates a new FormattingOptions literal.
1322
- */
1323
- function create(tabSize, insertSpaces) {
1324
- return { tabSize: tabSize, insertSpaces: insertSpaces };
1325
- }
1326
- FormattingOptions.create = create;
1327
- /**
1328
- * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.
1329
- */
1330
- function is(value) {
1331
- var candidate = value;
1332
- return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
1333
- }
1334
- FormattingOptions.is = is;
1335
- })(FormattingOptions = exports.FormattingOptions || (exports.FormattingOptions = {}));
1336
- /**
1337
- * The DocumentLink namespace provides helper functions to work with
1338
- * [DocumentLink](#DocumentLink) literals.
1339
- */
1340
- var DocumentLink;
1341
- (function (DocumentLink) {
1342
- /**
1343
- * Creates a new DocumentLink literal.
1344
- */
1345
- function create(range, target, data) {
1346
- return { range: range, target: target, data: data };
1347
- }
1348
- DocumentLink.create = create;
1349
- /**
1350
- * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.
1351
- */
1352
- function is(value) {
1353
- var candidate = value;
1354
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
1355
- }
1356
- DocumentLink.is = is;
1357
- })(DocumentLink = exports.DocumentLink || (exports.DocumentLink = {}));
1358
- /**
1359
- * The SelectionRange namespace provides helper function to work with
1360
- * SelectionRange literals.
1361
- */
1362
- var SelectionRange;
1363
- (function (SelectionRange) {
1364
- /**
1365
- * Creates a new SelectionRange
1366
- * @param range the range.
1367
- * @param parent an optional parent.
1368
- */
1369
- function create(range, parent) {
1370
- return { range: range, parent: parent };
1371
- }
1372
- SelectionRange.create = create;
1373
- function is(value) {
1374
- var candidate = value;
1375
- return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
1376
- }
1377
- SelectionRange.is = is;
1378
- })(SelectionRange = exports.SelectionRange || (exports.SelectionRange = {}));
1379
- exports.EOL = ['\n', '\r\n', '\r'];
1380
- /**
1381
- * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
1382
- */
1383
- var TextDocument;
1384
- (function (TextDocument) {
1385
- /**
1386
- * Creates a new ITextDocument literal from the given uri and content.
1387
- * @param uri The document's uri.
1388
- * @param languageId The document's language Id.
1389
- * @param content The document's content.
1390
- */
1391
- function create(uri, languageId, version, content) {
1392
- return new FullTextDocument(uri, languageId, version, content);
1393
- }
1394
- TextDocument.create = create;
1395
- /**
1396
- * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.
1397
- */
1398
- function is(value) {
1399
- var candidate = value;
1400
- return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)
1401
- && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
1402
- }
1403
- TextDocument.is = is;
1404
- function applyEdits(document, edits) {
1405
- var text = document.getText();
1406
- var sortedEdits = mergeSort(edits, function (a, b) {
1407
- var diff = a.range.start.line - b.range.start.line;
1408
- if (diff === 0) {
1409
- return a.range.start.character - b.range.start.character;
1410
- }
1411
- return diff;
1412
- });
1413
- var lastModifiedOffset = text.length;
1414
- for (var i = sortedEdits.length - 1; i >= 0; i--) {
1415
- var e = sortedEdits[i];
1416
- var startOffset = document.offsetAt(e.range.start);
1417
- var endOffset = document.offsetAt(e.range.end);
1418
- if (endOffset <= lastModifiedOffset) {
1419
- text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
1420
- }
1421
- else {
1422
- throw new Error('Overlapping edit');
1423
- }
1424
- lastModifiedOffset = startOffset;
1425
- }
1426
- return text;
1427
- }
1428
- TextDocument.applyEdits = applyEdits;
1429
- function mergeSort(data, compare) {
1430
- if (data.length <= 1) {
1431
- // sorted
1432
- return data;
1433
- }
1434
- var p = (data.length / 2) | 0;
1435
- var left = data.slice(0, p);
1436
- var right = data.slice(p);
1437
- mergeSort(left, compare);
1438
- mergeSort(right, compare);
1439
- var leftIdx = 0;
1440
- var rightIdx = 0;
1441
- var i = 0;
1442
- while (leftIdx < left.length && rightIdx < right.length) {
1443
- var ret = compare(left[leftIdx], right[rightIdx]);
1444
- if (ret <= 0) {
1445
- // smaller_equal -> take left to preserve order
1446
- data[i++] = left[leftIdx++];
1447
- }
1448
- else {
1449
- // greater -> take right
1450
- data[i++] = right[rightIdx++];
1451
- }
1452
- }
1453
- while (leftIdx < left.length) {
1454
- data[i++] = left[leftIdx++];
1455
- }
1456
- while (rightIdx < right.length) {
1457
- data[i++] = right[rightIdx++];
1458
- }
1459
- return data;
1460
- }
1461
- })(TextDocument = exports.TextDocument || (exports.TextDocument = {}));
1462
- var FullTextDocument = /** @class */ (function () {
1463
- function FullTextDocument(uri, languageId, version, content) {
1464
- this._uri = uri;
1465
- this._languageId = languageId;
1466
- this._version = version;
1467
- this._content = content;
1468
- this._lineOffsets = undefined;
1469
- }
1470
- Object.defineProperty(FullTextDocument.prototype, "uri", {
1471
- get: function () {
1472
- return this._uri;
1473
- },
1474
- enumerable: true,
1475
- configurable: true
1476
- });
1477
- Object.defineProperty(FullTextDocument.prototype, "languageId", {
1478
- get: function () {
1479
- return this._languageId;
1480
- },
1481
- enumerable: true,
1482
- configurable: true
1483
- });
1484
- Object.defineProperty(FullTextDocument.prototype, "version", {
1485
- get: function () {
1486
- return this._version;
1487
- },
1488
- enumerable: true,
1489
- configurable: true
1490
- });
1491
- FullTextDocument.prototype.getText = function (range) {
1492
- if (range) {
1493
- var start = this.offsetAt(range.start);
1494
- var end = this.offsetAt(range.end);
1495
- return this._content.substring(start, end);
1496
- }
1497
- return this._content;
1498
- };
1499
- FullTextDocument.prototype.update = function (event, version) {
1500
- this._content = event.text;
1501
- this._version = version;
1502
- this._lineOffsets = undefined;
1503
- };
1504
- FullTextDocument.prototype.getLineOffsets = function () {
1505
- if (this._lineOffsets === undefined) {
1506
- var lineOffsets = [];
1507
- var text = this._content;
1508
- var isLineStart = true;
1509
- for (var i = 0; i < text.length; i++) {
1510
- if (isLineStart) {
1511
- lineOffsets.push(i);
1512
- isLineStart = false;
1513
- }
1514
- var ch = text.charAt(i);
1515
- isLineStart = (ch === '\r' || ch === '\n');
1516
- if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
1517
- i++;
1518
- }
1519
- }
1520
- if (isLineStart && text.length > 0) {
1521
- lineOffsets.push(text.length);
1522
- }
1523
- this._lineOffsets = lineOffsets;
1524
- }
1525
- return this._lineOffsets;
1526
- };
1527
- FullTextDocument.prototype.positionAt = function (offset) {
1528
- offset = Math.max(Math.min(offset, this._content.length), 0);
1529
- var lineOffsets = this.getLineOffsets();
1530
- var low = 0, high = lineOffsets.length;
1531
- if (high === 0) {
1532
- return Position.create(0, offset);
1533
- }
1534
- while (low < high) {
1535
- var mid = Math.floor((low + high) / 2);
1536
- if (lineOffsets[mid] > offset) {
1537
- high = mid;
1538
- }
1539
- else {
1540
- low = mid + 1;
1541
- }
1542
- }
1543
- // low is the least x for which the line offset is larger than the current offset
1544
- // or array.length if no line offset is larger than the current offset
1545
- var line = low - 1;
1546
- return Position.create(line, offset - lineOffsets[line]);
1547
- };
1548
- FullTextDocument.prototype.offsetAt = function (position) {
1549
- var lineOffsets = this.getLineOffsets();
1550
- if (position.line >= lineOffsets.length) {
1551
- return this._content.length;
1552
- }
1553
- else if (position.line < 0) {
1554
- return 0;
1555
- }
1556
- var lineOffset = lineOffsets[position.line];
1557
- var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
1558
- return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
1559
- };
1560
- Object.defineProperty(FullTextDocument.prototype, "lineCount", {
1561
- get: function () {
1562
- return this.getLineOffsets().length;
1563
- },
1564
- enumerable: true,
1565
- configurable: true
1566
- });
1567
- return FullTextDocument;
1568
- }());
1569
- var Is;
1570
- (function (Is) {
1571
- var toString = Object.prototype.toString;
1572
- function defined(value) {
1573
- return typeof value !== 'undefined';
1574
- }
1575
- Is.defined = defined;
1576
- function undefined(value) {
1577
- return typeof value === 'undefined';
1578
- }
1579
- Is.undefined = undefined;
1580
- function boolean(value) {
1581
- return value === true || value === false;
1582
- }
1583
- Is.boolean = boolean;
1584
- function string(value) {
1585
- return toString.call(value) === '[object String]';
1586
- }
1587
- Is.string = string;
1588
- function number(value) {
1589
- return toString.call(value) === '[object Number]';
1590
- }
1591
- Is.number = number;
1592
- function func(value) {
1593
- return toString.call(value) === '[object Function]';
1594
- }
1595
- Is.func = func;
1596
- function objectLiteral(value) {
1597
- // Strictly speaking class instances pass this check as well. Since the LSP
1598
- // doesn't use classes we ignore this for now. If we do we need to add something
1599
- // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
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
- });
1609
-
71
+ (function (factory) {
72
+ if (typeof module === "object" && typeof module.exports === "object") {
73
+ var v = factory(require, exports);
74
+ if (v !== undefined) module.exports = v;
75
+ }
76
+ else if (typeof define === "function" && define.amd) {
77
+ define('vscode-languageserver-types/main',["require", "exports"], factory);
78
+ }
79
+ })(function (require, exports) {
80
+ /* --------------------------------------------------------------------------------------------
81
+ * Copyright (c) Microsoft Corporation. All rights reserved.
82
+ * Licensed under the MIT License. See License.txt in the project root for license information.
83
+ * ------------------------------------------------------------------------------------------ */
84
+ 'use strict';
85
+ Object.defineProperty(exports, "__esModule", { value: true });
86
+ exports.TextDocument = exports.EOL = exports.SelectionRange = exports.DocumentLink = exports.FormattingOptions = exports.CodeLens = exports.CodeAction = exports.CodeActionContext = exports.CodeActionKind = exports.DocumentSymbol = exports.SymbolInformation = exports.SymbolTag = exports.SymbolKind = exports.DocumentHighlight = exports.DocumentHighlightKind = exports.SignatureInformation = exports.ParameterInformation = exports.Hover = exports.MarkedString = exports.CompletionList = exports.CompletionItem = exports.InsertTextMode = exports.InsertReplaceEdit = exports.CompletionItemTag = exports.InsertTextFormat = exports.CompletionItemKind = exports.MarkupContent = exports.MarkupKind = exports.TextDocumentItem = exports.OptionalVersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier = exports.TextDocumentIdentifier = exports.WorkspaceChange = exports.WorkspaceEdit = exports.DeleteFile = exports.RenameFile = exports.CreateFile = exports.TextDocumentEdit = exports.AnnotatedTextEdit = exports.ChangeAnnotationIdentifier = exports.ChangeAnnotation = exports.TextEdit = exports.Command = exports.Diagnostic = exports.CodeDescription = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.DiagnosticRelatedInformation = exports.FoldingRange = exports.FoldingRangeKind = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.LocationLink = exports.Location = exports.Range = exports.Position = exports.uinteger = exports.integer = void 0;
87
+ var integer;
88
+ (function (integer) {
89
+ integer.MIN_VALUE = -2147483648;
90
+ integer.MAX_VALUE = 2147483647;
91
+ })(integer = exports.integer || (exports.integer = {}));
92
+ var uinteger;
93
+ (function (uinteger) {
94
+ uinteger.MIN_VALUE = 0;
95
+ uinteger.MAX_VALUE = 2147483647;
96
+ })(uinteger = exports.uinteger || (exports.uinteger = {}));
97
+ /**
98
+ * The Position namespace provides helper functions to work with
99
+ * [Position](#Position) literals.
100
+ */
101
+ var Position;
102
+ (function (Position) {
103
+ /**
104
+ * Creates a new Position literal from the given line and character.
105
+ * @param line The position's line.
106
+ * @param character The position's character.
107
+ */
108
+ function create(line, character) {
109
+ if (line === Number.MAX_VALUE) {
110
+ line = uinteger.MAX_VALUE;
111
+ }
112
+ if (character === Number.MAX_VALUE) {
113
+ character = uinteger.MAX_VALUE;
114
+ }
115
+ return { line: line, character: character };
116
+ }
117
+ Position.create = create;
118
+ /**
119
+ * Checks whether the given literal conforms to the [Position](#Position) interface.
120
+ */
121
+ function is(value) {
122
+ var candidate = value;
123
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
124
+ }
125
+ Position.is = is;
126
+ })(Position = exports.Position || (exports.Position = {}));
127
+ /**
128
+ * The Range namespace provides helper functions to work with
129
+ * [Range](#Range) literals.
130
+ */
131
+ var Range;
132
+ (function (Range) {
133
+ function create(one, two, three, four) {
134
+ if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
135
+ return { start: Position.create(one, two), end: Position.create(three, four) };
136
+ }
137
+ else if (Position.is(one) && Position.is(two)) {
138
+ return { start: one, end: two };
139
+ }
140
+ else {
141
+ throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
142
+ }
143
+ }
144
+ Range.create = create;
145
+ /**
146
+ * Checks whether the given literal conforms to the [Range](#Range) interface.
147
+ */
148
+ function is(value) {
149
+ var candidate = value;
150
+ return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
151
+ }
152
+ Range.is = is;
153
+ })(Range = exports.Range || (exports.Range = {}));
154
+ /**
155
+ * The Location namespace provides helper functions to work with
156
+ * [Location](#Location) literals.
157
+ */
158
+ var Location;
159
+ (function (Location) {
160
+ /**
161
+ * Creates a Location literal.
162
+ * @param uri The location's uri.
163
+ * @param range The location's range.
164
+ */
165
+ function create(uri, range) {
166
+ return { uri: uri, range: range };
167
+ }
168
+ Location.create = create;
169
+ /**
170
+ * Checks whether the given literal conforms to the [Location](#Location) interface.
171
+ */
172
+ function is(value) {
173
+ var candidate = value;
174
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
175
+ }
176
+ Location.is = is;
177
+ })(Location = exports.Location || (exports.Location = {}));
178
+ /**
179
+ * The LocationLink namespace provides helper functions to work with
180
+ * [LocationLink](#LocationLink) literals.
181
+ */
182
+ var LocationLink;
183
+ (function (LocationLink) {
184
+ /**
185
+ * Creates a LocationLink literal.
186
+ * @param targetUri The definition's uri.
187
+ * @param targetRange The full range of the definition.
188
+ * @param targetSelectionRange The span of the symbol definition at the target.
189
+ * @param originSelectionRange The span of the symbol being defined in the originating source file.
190
+ */
191
+ function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
192
+ return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
193
+ }
194
+ LocationLink.create = create;
195
+ /**
196
+ * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.
197
+ */
198
+ function is(value) {
199
+ var candidate = value;
200
+ return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
201
+ && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))
202
+ && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
203
+ }
204
+ LocationLink.is = is;
205
+ })(LocationLink = exports.LocationLink || (exports.LocationLink = {}));
206
+ /**
207
+ * The Color namespace provides helper functions to work with
208
+ * [Color](#Color) literals.
209
+ */
210
+ var Color;
211
+ (function (Color) {
212
+ /**
213
+ * Creates a new Color literal.
214
+ */
215
+ function create(red, green, blue, alpha) {
216
+ return {
217
+ red: red,
218
+ green: green,
219
+ blue: blue,
220
+ alpha: alpha,
221
+ };
222
+ }
223
+ Color.create = create;
224
+ /**
225
+ * Checks whether the given literal conforms to the [Color](#Color) interface.
226
+ */
227
+ function is(value) {
228
+ var candidate = value;
229
+ return Is.numberRange(candidate.red, 0, 1)
230
+ && Is.numberRange(candidate.green, 0, 1)
231
+ && Is.numberRange(candidate.blue, 0, 1)
232
+ && Is.numberRange(candidate.alpha, 0, 1);
233
+ }
234
+ Color.is = is;
235
+ })(Color = exports.Color || (exports.Color = {}));
236
+ /**
237
+ * The ColorInformation namespace provides helper functions to work with
238
+ * [ColorInformation](#ColorInformation) literals.
239
+ */
240
+ var ColorInformation;
241
+ (function (ColorInformation) {
242
+ /**
243
+ * Creates a new ColorInformation literal.
244
+ */
245
+ function create(range, color) {
246
+ return {
247
+ range: range,
248
+ color: color,
249
+ };
250
+ }
251
+ ColorInformation.create = create;
252
+ /**
253
+ * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.
254
+ */
255
+ function is(value) {
256
+ var candidate = value;
257
+ return Range.is(candidate.range) && Color.is(candidate.color);
258
+ }
259
+ ColorInformation.is = is;
260
+ })(ColorInformation = exports.ColorInformation || (exports.ColorInformation = {}));
261
+ /**
262
+ * The Color namespace provides helper functions to work with
263
+ * [ColorPresentation](#ColorPresentation) literals.
264
+ */
265
+ var ColorPresentation;
266
+ (function (ColorPresentation) {
267
+ /**
268
+ * Creates a new ColorInformation literal.
269
+ */
270
+ function create(label, textEdit, additionalTextEdits) {
271
+ return {
272
+ label: label,
273
+ textEdit: textEdit,
274
+ additionalTextEdits: additionalTextEdits,
275
+ };
276
+ }
277
+ ColorPresentation.create = create;
278
+ /**
279
+ * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.
280
+ */
281
+ function is(value) {
282
+ var candidate = value;
283
+ return Is.string(candidate.label)
284
+ && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
285
+ && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
286
+ }
287
+ ColorPresentation.is = is;
288
+ })(ColorPresentation = exports.ColorPresentation || (exports.ColorPresentation = {}));
289
+ /**
290
+ * Enum of known range kinds
291
+ */
292
+ var FoldingRangeKind;
293
+ (function (FoldingRangeKind) {
294
+ /**
295
+ * Folding range for a comment
296
+ */
297
+ FoldingRangeKind["Comment"] = "comment";
298
+ /**
299
+ * Folding range for a imports or includes
300
+ */
301
+ FoldingRangeKind["Imports"] = "imports";
302
+ /**
303
+ * Folding range for a region (e.g. `#region`)
304
+ */
305
+ FoldingRangeKind["Region"] = "region";
306
+ })(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));
307
+ /**
308
+ * The folding range namespace provides helper functions to work with
309
+ * [FoldingRange](#FoldingRange) literals.
310
+ */
311
+ var FoldingRange;
312
+ (function (FoldingRange) {
313
+ /**
314
+ * Creates a new FoldingRange literal.
315
+ */
316
+ function create(startLine, endLine, startCharacter, endCharacter, kind) {
317
+ var result = {
318
+ startLine: startLine,
319
+ endLine: endLine
320
+ };
321
+ if (Is.defined(startCharacter)) {
322
+ result.startCharacter = startCharacter;
323
+ }
324
+ if (Is.defined(endCharacter)) {
325
+ result.endCharacter = endCharacter;
326
+ }
327
+ if (Is.defined(kind)) {
328
+ result.kind = kind;
329
+ }
330
+ return result;
331
+ }
332
+ FoldingRange.create = create;
333
+ /**
334
+ * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.
335
+ */
336
+ function is(value) {
337
+ var candidate = value;
338
+ return Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)
339
+ && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
340
+ && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
341
+ && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
342
+ }
343
+ FoldingRange.is = is;
344
+ })(FoldingRange = exports.FoldingRange || (exports.FoldingRange = {}));
345
+ /**
346
+ * The DiagnosticRelatedInformation namespace provides helper functions to work with
347
+ * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.
348
+ */
349
+ var DiagnosticRelatedInformation;
350
+ (function (DiagnosticRelatedInformation) {
351
+ /**
352
+ * Creates a new DiagnosticRelatedInformation literal.
353
+ */
354
+ function create(location, message) {
355
+ return {
356
+ location: location,
357
+ message: message
358
+ };
359
+ }
360
+ DiagnosticRelatedInformation.create = create;
361
+ /**
362
+ * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.
363
+ */
364
+ function is(value) {
365
+ var candidate = value;
366
+ return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
367
+ }
368
+ DiagnosticRelatedInformation.is = is;
369
+ })(DiagnosticRelatedInformation = exports.DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = {}));
370
+ /**
371
+ * The diagnostic's severity.
372
+ */
373
+ var DiagnosticSeverity;
374
+ (function (DiagnosticSeverity) {
375
+ /**
376
+ * Reports an error.
377
+ */
378
+ DiagnosticSeverity.Error = 1;
379
+ /**
380
+ * Reports a warning.
381
+ */
382
+ DiagnosticSeverity.Warning = 2;
383
+ /**
384
+ * Reports an information.
385
+ */
386
+ DiagnosticSeverity.Information = 3;
387
+ /**
388
+ * Reports a hint.
389
+ */
390
+ DiagnosticSeverity.Hint = 4;
391
+ })(DiagnosticSeverity = exports.DiagnosticSeverity || (exports.DiagnosticSeverity = {}));
392
+ /**
393
+ * The diagnostic tags.
394
+ *
395
+ * @since 3.15.0
396
+ */
397
+ var DiagnosticTag;
398
+ (function (DiagnosticTag) {
399
+ /**
400
+ * Unused or unnecessary code.
401
+ *
402
+ * Clients are allowed to render diagnostics with this tag faded out instead of having
403
+ * an error squiggle.
404
+ */
405
+ DiagnosticTag.Unnecessary = 1;
406
+ /**
407
+ * Deprecated or obsolete code.
408
+ *
409
+ * Clients are allowed to rendered diagnostics with this tag strike through.
410
+ */
411
+ DiagnosticTag.Deprecated = 2;
412
+ })(DiagnosticTag = exports.DiagnosticTag || (exports.DiagnosticTag = {}));
413
+ /**
414
+ * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.
415
+ *
416
+ * @since 3.16.0
417
+ */
418
+ var CodeDescription;
419
+ (function (CodeDescription) {
420
+ function is(value) {
421
+ var candidate = value;
422
+ return candidate !== undefined && candidate !== null && Is.string(candidate.href);
423
+ }
424
+ CodeDescription.is = is;
425
+ })(CodeDescription = exports.CodeDescription || (exports.CodeDescription = {}));
426
+ /**
427
+ * The Diagnostic namespace provides helper functions to work with
428
+ * [Diagnostic](#Diagnostic) literals.
429
+ */
430
+ var Diagnostic;
431
+ (function (Diagnostic) {
432
+ /**
433
+ * Creates a new Diagnostic literal.
434
+ */
435
+ function create(range, message, severity, code, source, relatedInformation) {
436
+ var result = { range: range, message: message };
437
+ if (Is.defined(severity)) {
438
+ result.severity = severity;
439
+ }
440
+ if (Is.defined(code)) {
441
+ result.code = code;
442
+ }
443
+ if (Is.defined(source)) {
444
+ result.source = source;
445
+ }
446
+ if (Is.defined(relatedInformation)) {
447
+ result.relatedInformation = relatedInformation;
448
+ }
449
+ return result;
450
+ }
451
+ Diagnostic.create = create;
452
+ /**
453
+ * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.
454
+ */
455
+ function is(value) {
456
+ var _a;
457
+ var candidate = value;
458
+ return Is.defined(candidate)
459
+ && Range.is(candidate.range)
460
+ && Is.string(candidate.message)
461
+ && (Is.number(candidate.severity) || Is.undefined(candidate.severity))
462
+ && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
463
+ && (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))
464
+ && (Is.string(candidate.source) || Is.undefined(candidate.source))
465
+ && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
466
+ }
467
+ Diagnostic.is = is;
468
+ })(Diagnostic = exports.Diagnostic || (exports.Diagnostic = {}));
469
+ /**
470
+ * The Command namespace provides helper functions to work with
471
+ * [Command](#Command) literals.
472
+ */
473
+ var Command;
474
+ (function (Command) {
475
+ /**
476
+ * Creates a new Command literal.
477
+ */
478
+ function create(title, command) {
479
+ var args = [];
480
+ for (var _i = 2; _i < arguments.length; _i++) {
481
+ args[_i - 2] = arguments[_i];
482
+ }
483
+ var result = { title: title, command: command };
484
+ if (Is.defined(args) && args.length > 0) {
485
+ result.arguments = args;
486
+ }
487
+ return result;
488
+ }
489
+ Command.create = create;
490
+ /**
491
+ * Checks whether the given literal conforms to the [Command](#Command) interface.
492
+ */
493
+ function is(value) {
494
+ var candidate = value;
495
+ return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
496
+ }
497
+ Command.is = is;
498
+ })(Command = exports.Command || (exports.Command = {}));
499
+ /**
500
+ * The TextEdit namespace provides helper function to create replace,
501
+ * insert and delete edits more easily.
502
+ */
503
+ var TextEdit;
504
+ (function (TextEdit) {
505
+ /**
506
+ * Creates a replace text edit.
507
+ * @param range The range of text to be replaced.
508
+ * @param newText The new text.
509
+ */
510
+ function replace(range, newText) {
511
+ return { range: range, newText: newText };
512
+ }
513
+ TextEdit.replace = replace;
514
+ /**
515
+ * Creates a insert text edit.
516
+ * @param position The position to insert the text at.
517
+ * @param newText The text to be inserted.
518
+ */
519
+ function insert(position, newText) {
520
+ return { range: { start: position, end: position }, newText: newText };
521
+ }
522
+ TextEdit.insert = insert;
523
+ /**
524
+ * Creates a delete text edit.
525
+ * @param range The range of text to be deleted.
526
+ */
527
+ function del(range) {
528
+ return { range: range, newText: '' };
529
+ }
530
+ TextEdit.del = del;
531
+ function is(value) {
532
+ var candidate = value;
533
+ return Is.objectLiteral(candidate)
534
+ && Is.string(candidate.newText)
535
+ && Range.is(candidate.range);
536
+ }
537
+ TextEdit.is = is;
538
+ })(TextEdit = exports.TextEdit || (exports.TextEdit = {}));
539
+ var ChangeAnnotation;
540
+ (function (ChangeAnnotation) {
541
+ function create(label, needsConfirmation, description) {
542
+ var result = { label: label };
543
+ if (needsConfirmation !== undefined) {
544
+ result.needsConfirmation = needsConfirmation;
545
+ }
546
+ if (description !== undefined) {
547
+ result.description = description;
548
+ }
549
+ return result;
550
+ }
551
+ ChangeAnnotation.create = create;
552
+ function is(value) {
553
+ var candidate = value;
554
+ return candidate !== undefined && Is.objectLiteral(candidate) && Is.string(candidate.label) &&
555
+ (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&
556
+ (Is.string(candidate.description) || candidate.description === undefined);
557
+ }
558
+ ChangeAnnotation.is = is;
559
+ })(ChangeAnnotation = exports.ChangeAnnotation || (exports.ChangeAnnotation = {}));
560
+ var ChangeAnnotationIdentifier;
561
+ (function (ChangeAnnotationIdentifier) {
562
+ function is(value) {
563
+ var candidate = value;
564
+ return typeof candidate === 'string';
565
+ }
566
+ ChangeAnnotationIdentifier.is = is;
567
+ })(ChangeAnnotationIdentifier = exports.ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = {}));
568
+ var AnnotatedTextEdit;
569
+ (function (AnnotatedTextEdit) {
570
+ /**
571
+ * Creates an annotated replace text edit.
572
+ *
573
+ * @param range The range of text to be replaced.
574
+ * @param newText The new text.
575
+ * @param annotation The annotation.
576
+ */
577
+ function replace(range, newText, annotation) {
578
+ return { range: range, newText: newText, annotationId: annotation };
579
+ }
580
+ AnnotatedTextEdit.replace = replace;
581
+ /**
582
+ * Creates an annotated insert text edit.
583
+ *
584
+ * @param position The position to insert the text at.
585
+ * @param newText The text to be inserted.
586
+ * @param annotation The annotation.
587
+ */
588
+ function insert(position, newText, annotation) {
589
+ return { range: { start: position, end: position }, newText: newText, annotationId: annotation };
590
+ }
591
+ AnnotatedTextEdit.insert = insert;
592
+ /**
593
+ * Creates an annotated delete text edit.
594
+ *
595
+ * @param range The range of text to be deleted.
596
+ * @param annotation The annotation.
597
+ */
598
+ function del(range, annotation) {
599
+ return { range: range, newText: '', annotationId: annotation };
600
+ }
601
+ AnnotatedTextEdit.del = del;
602
+ function is(value) {
603
+ var candidate = value;
604
+ return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
605
+ }
606
+ AnnotatedTextEdit.is = is;
607
+ })(AnnotatedTextEdit = exports.AnnotatedTextEdit || (exports.AnnotatedTextEdit = {}));
608
+ /**
609
+ * The TextDocumentEdit namespace provides helper function to create
610
+ * an edit that manipulates a text document.
611
+ */
612
+ var TextDocumentEdit;
613
+ (function (TextDocumentEdit) {
614
+ /**
615
+ * Creates a new `TextDocumentEdit`
616
+ */
617
+ function create(textDocument, edits) {
618
+ return { textDocument: textDocument, edits: edits };
619
+ }
620
+ TextDocumentEdit.create = create;
621
+ function is(value) {
622
+ var candidate = value;
623
+ return Is.defined(candidate)
624
+ && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)
625
+ && Array.isArray(candidate.edits);
626
+ }
627
+ TextDocumentEdit.is = is;
628
+ })(TextDocumentEdit = exports.TextDocumentEdit || (exports.TextDocumentEdit = {}));
629
+ var CreateFile;
630
+ (function (CreateFile) {
631
+ function create(uri, options, annotation) {
632
+ var result = {
633
+ kind: 'create',
634
+ uri: uri
635
+ };
636
+ if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
637
+ result.options = options;
638
+ }
639
+ if (annotation !== undefined) {
640
+ result.annotationId = annotation;
641
+ }
642
+ return result;
643
+ }
644
+ CreateFile.create = create;
645
+ function is(value) {
646
+ var candidate = value;
647
+ return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||
648
+ ((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));
649
+ }
650
+ CreateFile.is = is;
651
+ })(CreateFile = exports.CreateFile || (exports.CreateFile = {}));
652
+ var RenameFile;
653
+ (function (RenameFile) {
654
+ function create(oldUri, newUri, options, annotation) {
655
+ var result = {
656
+ kind: 'rename',
657
+ oldUri: oldUri,
658
+ newUri: newUri
659
+ };
660
+ if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
661
+ result.options = options;
662
+ }
663
+ if (annotation !== undefined) {
664
+ result.annotationId = annotation;
665
+ }
666
+ return result;
667
+ }
668
+ RenameFile.create = create;
669
+ function is(value) {
670
+ var candidate = value;
671
+ return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||
672
+ ((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));
673
+ }
674
+ RenameFile.is = is;
675
+ })(RenameFile = exports.RenameFile || (exports.RenameFile = {}));
676
+ var DeleteFile;
677
+ (function (DeleteFile) {
678
+ function create(uri, options, annotation) {
679
+ var result = {
680
+ kind: 'delete',
681
+ uri: uri
682
+ };
683
+ if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {
684
+ result.options = options;
685
+ }
686
+ if (annotation !== undefined) {
687
+ result.annotationId = annotation;
688
+ }
689
+ return result;
690
+ }
691
+ DeleteFile.create = create;
692
+ function is(value) {
693
+ var candidate = value;
694
+ return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||
695
+ ((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));
696
+ }
697
+ DeleteFile.is = is;
698
+ })(DeleteFile = exports.DeleteFile || (exports.DeleteFile = {}));
699
+ var WorkspaceEdit;
700
+ (function (WorkspaceEdit) {
701
+ function is(value) {
702
+ var candidate = value;
703
+ return candidate &&
704
+ (candidate.changes !== undefined || candidate.documentChanges !== undefined) &&
705
+ (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {
706
+ if (Is.string(change.kind)) {
707
+ return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
708
+ }
709
+ else {
710
+ return TextDocumentEdit.is(change);
711
+ }
712
+ }));
713
+ }
714
+ WorkspaceEdit.is = is;
715
+ })(WorkspaceEdit = exports.WorkspaceEdit || (exports.WorkspaceEdit = {}));
716
+ var TextEditChangeImpl = /** @class */ (function () {
717
+ function TextEditChangeImpl(edits, changeAnnotations) {
718
+ this.edits = edits;
719
+ this.changeAnnotations = changeAnnotations;
720
+ }
721
+ TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {
722
+ var edit;
723
+ var id;
724
+ if (annotation === undefined) {
725
+ edit = TextEdit.insert(position, newText);
726
+ }
727
+ else if (ChangeAnnotationIdentifier.is(annotation)) {
728
+ id = annotation;
729
+ edit = AnnotatedTextEdit.insert(position, newText, annotation);
730
+ }
731
+ else {
732
+ this.assertChangeAnnotations(this.changeAnnotations);
733
+ id = this.changeAnnotations.manage(annotation);
734
+ edit = AnnotatedTextEdit.insert(position, newText, id);
735
+ }
736
+ this.edits.push(edit);
737
+ if (id !== undefined) {
738
+ return id;
739
+ }
740
+ };
741
+ TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {
742
+ var edit;
743
+ var id;
744
+ if (annotation === undefined) {
745
+ edit = TextEdit.replace(range, newText);
746
+ }
747
+ else if (ChangeAnnotationIdentifier.is(annotation)) {
748
+ id = annotation;
749
+ edit = AnnotatedTextEdit.replace(range, newText, annotation);
750
+ }
751
+ else {
752
+ this.assertChangeAnnotations(this.changeAnnotations);
753
+ id = this.changeAnnotations.manage(annotation);
754
+ edit = AnnotatedTextEdit.replace(range, newText, id);
755
+ }
756
+ this.edits.push(edit);
757
+ if (id !== undefined) {
758
+ return id;
759
+ }
760
+ };
761
+ TextEditChangeImpl.prototype.delete = function (range, annotation) {
762
+ var edit;
763
+ var id;
764
+ if (annotation === undefined) {
765
+ edit = TextEdit.del(range);
766
+ }
767
+ else if (ChangeAnnotationIdentifier.is(annotation)) {
768
+ id = annotation;
769
+ edit = AnnotatedTextEdit.del(range, annotation);
770
+ }
771
+ else {
772
+ this.assertChangeAnnotations(this.changeAnnotations);
773
+ id = this.changeAnnotations.manage(annotation);
774
+ edit = AnnotatedTextEdit.del(range, id);
775
+ }
776
+ this.edits.push(edit);
777
+ if (id !== undefined) {
778
+ return id;
779
+ }
780
+ };
781
+ TextEditChangeImpl.prototype.add = function (edit) {
782
+ this.edits.push(edit);
783
+ };
784
+ TextEditChangeImpl.prototype.all = function () {
785
+ return this.edits;
786
+ };
787
+ TextEditChangeImpl.prototype.clear = function () {
788
+ this.edits.splice(0, this.edits.length);
789
+ };
790
+ TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {
791
+ if (value === undefined) {
792
+ throw new Error("Text edit change is not configured to manage change annotations.");
793
+ }
794
+ };
795
+ return TextEditChangeImpl;
796
+ }());
797
+ /**
798
+ * A helper class
799
+ */
800
+ var ChangeAnnotations = /** @class */ (function () {
801
+ function ChangeAnnotations(annotations) {
802
+ this._annotations = annotations === undefined ? Object.create(null) : annotations;
803
+ this._counter = 0;
804
+ this._size = 0;
805
+ }
806
+ ChangeAnnotations.prototype.all = function () {
807
+ return this._annotations;
808
+ };
809
+ Object.defineProperty(ChangeAnnotations.prototype, "size", {
810
+ get: function () {
811
+ return this._size;
812
+ },
813
+ enumerable: false,
814
+ configurable: true
815
+ });
816
+ ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {
817
+ var id;
818
+ if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
819
+ id = idOrAnnotation;
820
+ }
821
+ else {
822
+ id = this.nextId();
823
+ annotation = idOrAnnotation;
824
+ }
825
+ if (this._annotations[id] !== undefined) {
826
+ throw new Error("Id " + id + " is already in use.");
827
+ }
828
+ if (annotation === undefined) {
829
+ throw new Error("No annotation provided for id " + id);
830
+ }
831
+ this._annotations[id] = annotation;
832
+ this._size++;
833
+ return id;
834
+ };
835
+ ChangeAnnotations.prototype.nextId = function () {
836
+ this._counter++;
837
+ return this._counter.toString();
838
+ };
839
+ return ChangeAnnotations;
840
+ }());
841
+ /**
842
+ * A workspace change helps constructing changes to a workspace.
843
+ */
844
+ var WorkspaceChange = /** @class */ (function () {
845
+ function WorkspaceChange(workspaceEdit) {
846
+ var _this = this;
847
+ this._textEditChanges = Object.create(null);
848
+ if (workspaceEdit !== undefined) {
849
+ this._workspaceEdit = workspaceEdit;
850
+ if (workspaceEdit.documentChanges) {
851
+ this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
852
+ workspaceEdit.changeAnnotations = this._changeAnnotations.all();
853
+ workspaceEdit.documentChanges.forEach(function (change) {
854
+ if (TextDocumentEdit.is(change)) {
855
+ var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
856
+ _this._textEditChanges[change.textDocument.uri] = textEditChange;
857
+ }
858
+ });
859
+ }
860
+ else if (workspaceEdit.changes) {
861
+ Object.keys(workspaceEdit.changes).forEach(function (key) {
862
+ var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
863
+ _this._textEditChanges[key] = textEditChange;
864
+ });
865
+ }
866
+ }
867
+ else {
868
+ this._workspaceEdit = {};
869
+ }
870
+ }
871
+ Object.defineProperty(WorkspaceChange.prototype, "edit", {
872
+ /**
873
+ * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal
874
+ * use to be returned from a workspace edit operation like rename.
875
+ */
876
+ get: function () {
877
+ this.initDocumentChanges();
878
+ if (this._changeAnnotations !== undefined) {
879
+ if (this._changeAnnotations.size === 0) {
880
+ this._workspaceEdit.changeAnnotations = undefined;
881
+ }
882
+ else {
883
+ this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
884
+ }
885
+ }
886
+ return this._workspaceEdit;
887
+ },
888
+ enumerable: false,
889
+ configurable: true
890
+ });
891
+ WorkspaceChange.prototype.getTextEditChange = function (key) {
892
+ if (OptionalVersionedTextDocumentIdentifier.is(key)) {
893
+ this.initDocumentChanges();
894
+ if (this._workspaceEdit.documentChanges === undefined) {
895
+ throw new Error('Workspace edit is not configured for document changes.');
896
+ }
897
+ var textDocument = { uri: key.uri, version: key.version };
898
+ var result = this._textEditChanges[textDocument.uri];
899
+ if (!result) {
900
+ var edits = [];
901
+ var textDocumentEdit = {
902
+ textDocument: textDocument,
903
+ edits: edits
904
+ };
905
+ this._workspaceEdit.documentChanges.push(textDocumentEdit);
906
+ result = new TextEditChangeImpl(edits, this._changeAnnotations);
907
+ this._textEditChanges[textDocument.uri] = result;
908
+ }
909
+ return result;
910
+ }
911
+ else {
912
+ this.initChanges();
913
+ if (this._workspaceEdit.changes === undefined) {
914
+ throw new Error('Workspace edit is not configured for normal text edit changes.');
915
+ }
916
+ var result = this._textEditChanges[key];
917
+ if (!result) {
918
+ var edits = [];
919
+ this._workspaceEdit.changes[key] = edits;
920
+ result = new TextEditChangeImpl(edits);
921
+ this._textEditChanges[key] = result;
922
+ }
923
+ return result;
924
+ }
925
+ };
926
+ WorkspaceChange.prototype.initDocumentChanges = function () {
927
+ if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
928
+ this._changeAnnotations = new ChangeAnnotations();
929
+ this._workspaceEdit.documentChanges = [];
930
+ this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
931
+ }
932
+ };
933
+ WorkspaceChange.prototype.initChanges = function () {
934
+ if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
935
+ this._workspaceEdit.changes = Object.create(null);
936
+ }
937
+ };
938
+ WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {
939
+ this.initDocumentChanges();
940
+ if (this._workspaceEdit.documentChanges === undefined) {
941
+ throw new Error('Workspace edit is not configured for document changes.');
942
+ }
943
+ var annotation;
944
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
945
+ annotation = optionsOrAnnotation;
946
+ }
947
+ else {
948
+ options = optionsOrAnnotation;
949
+ }
950
+ var operation;
951
+ var id;
952
+ if (annotation === undefined) {
953
+ operation = CreateFile.create(uri, options);
954
+ }
955
+ else {
956
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
957
+ operation = CreateFile.create(uri, options, id);
958
+ }
959
+ this._workspaceEdit.documentChanges.push(operation);
960
+ if (id !== undefined) {
961
+ return id;
962
+ }
963
+ };
964
+ WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {
965
+ this.initDocumentChanges();
966
+ if (this._workspaceEdit.documentChanges === undefined) {
967
+ throw new Error('Workspace edit is not configured for document changes.');
968
+ }
969
+ var annotation;
970
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
971
+ annotation = optionsOrAnnotation;
972
+ }
973
+ else {
974
+ options = optionsOrAnnotation;
975
+ }
976
+ var operation;
977
+ var id;
978
+ if (annotation === undefined) {
979
+ operation = RenameFile.create(oldUri, newUri, options);
980
+ }
981
+ else {
982
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
983
+ operation = RenameFile.create(oldUri, newUri, options, id);
984
+ }
985
+ this._workspaceEdit.documentChanges.push(operation);
986
+ if (id !== undefined) {
987
+ return id;
988
+ }
989
+ };
990
+ WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {
991
+ this.initDocumentChanges();
992
+ if (this._workspaceEdit.documentChanges === undefined) {
993
+ throw new Error('Workspace edit is not configured for document changes.');
994
+ }
995
+ var annotation;
996
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
997
+ annotation = optionsOrAnnotation;
998
+ }
999
+ else {
1000
+ options = optionsOrAnnotation;
1001
+ }
1002
+ var operation;
1003
+ var id;
1004
+ if (annotation === undefined) {
1005
+ operation = DeleteFile.create(uri, options);
1006
+ }
1007
+ else {
1008
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
1009
+ operation = DeleteFile.create(uri, options, id);
1010
+ }
1011
+ this._workspaceEdit.documentChanges.push(operation);
1012
+ if (id !== undefined) {
1013
+ return id;
1014
+ }
1015
+ };
1016
+ return WorkspaceChange;
1017
+ }());
1018
+ exports.WorkspaceChange = WorkspaceChange;
1019
+ /**
1020
+ * The TextDocumentIdentifier namespace provides helper functions to work with
1021
+ * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.
1022
+ */
1023
+ var TextDocumentIdentifier;
1024
+ (function (TextDocumentIdentifier) {
1025
+ /**
1026
+ * Creates a new TextDocumentIdentifier literal.
1027
+ * @param uri The document's uri.
1028
+ */
1029
+ function create(uri) {
1030
+ return { uri: uri };
1031
+ }
1032
+ TextDocumentIdentifier.create = create;
1033
+ /**
1034
+ * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.
1035
+ */
1036
+ function is(value) {
1037
+ var candidate = value;
1038
+ return Is.defined(candidate) && Is.string(candidate.uri);
1039
+ }
1040
+ TextDocumentIdentifier.is = is;
1041
+ })(TextDocumentIdentifier = exports.TextDocumentIdentifier || (exports.TextDocumentIdentifier = {}));
1042
+ /**
1043
+ * The VersionedTextDocumentIdentifier namespace provides helper functions to work with
1044
+ * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.
1045
+ */
1046
+ var VersionedTextDocumentIdentifier;
1047
+ (function (VersionedTextDocumentIdentifier) {
1048
+ /**
1049
+ * Creates a new VersionedTextDocumentIdentifier literal.
1050
+ * @param uri The document's uri.
1051
+ * @param uri The document's text.
1052
+ */
1053
+ function create(uri, version) {
1054
+ return { uri: uri, version: version };
1055
+ }
1056
+ VersionedTextDocumentIdentifier.create = create;
1057
+ /**
1058
+ * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.
1059
+ */
1060
+ function is(value) {
1061
+ var candidate = value;
1062
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
1063
+ }
1064
+ VersionedTextDocumentIdentifier.is = is;
1065
+ })(VersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = {}));
1066
+ /**
1067
+ * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with
1068
+ * [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) literals.
1069
+ */
1070
+ var OptionalVersionedTextDocumentIdentifier;
1071
+ (function (OptionalVersionedTextDocumentIdentifier) {
1072
+ /**
1073
+ * Creates a new OptionalVersionedTextDocumentIdentifier literal.
1074
+ * @param uri The document's uri.
1075
+ * @param uri The document's text.
1076
+ */
1077
+ function create(uri, version) {
1078
+ return { uri: uri, version: version };
1079
+ }
1080
+ OptionalVersionedTextDocumentIdentifier.create = create;
1081
+ /**
1082
+ * Checks whether the given literal conforms to the [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) interface.
1083
+ */
1084
+ function is(value) {
1085
+ var candidate = value;
1086
+ return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
1087
+ }
1088
+ OptionalVersionedTextDocumentIdentifier.is = is;
1089
+ })(OptionalVersionedTextDocumentIdentifier = exports.OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = {}));
1090
+ /**
1091
+ * The TextDocumentItem namespace provides helper functions to work with
1092
+ * [TextDocumentItem](#TextDocumentItem) literals.
1093
+ */
1094
+ var TextDocumentItem;
1095
+ (function (TextDocumentItem) {
1096
+ /**
1097
+ * Creates a new TextDocumentItem literal.
1098
+ * @param uri The document's uri.
1099
+ * @param languageId The document's language identifier.
1100
+ * @param version The document's version number.
1101
+ * @param text The document's text.
1102
+ */
1103
+ function create(uri, languageId, version, text) {
1104
+ return { uri: uri, languageId: languageId, version: version, text: text };
1105
+ }
1106
+ TextDocumentItem.create = create;
1107
+ /**
1108
+ * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.
1109
+ */
1110
+ function is(value) {
1111
+ var candidate = value;
1112
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
1113
+ }
1114
+ TextDocumentItem.is = is;
1115
+ })(TextDocumentItem = exports.TextDocumentItem || (exports.TextDocumentItem = {}));
1116
+ /**
1117
+ * Describes the content type that a client supports in various
1118
+ * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
1119
+ *
1120
+ * Please note that `MarkupKinds` must not start with a `$`. This kinds
1121
+ * are reserved for internal usage.
1122
+ */
1123
+ var MarkupKind;
1124
+ (function (MarkupKind) {
1125
+ /**
1126
+ * Plain text is supported as a content format
1127
+ */
1128
+ MarkupKind.PlainText = 'plaintext';
1129
+ /**
1130
+ * Markdown is supported as a content format
1131
+ */
1132
+ MarkupKind.Markdown = 'markdown';
1133
+ })(MarkupKind = exports.MarkupKind || (exports.MarkupKind = {}));
1134
+ (function (MarkupKind) {
1135
+ /**
1136
+ * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.
1137
+ */
1138
+ function is(value) {
1139
+ var candidate = value;
1140
+ return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
1141
+ }
1142
+ MarkupKind.is = is;
1143
+ })(MarkupKind = exports.MarkupKind || (exports.MarkupKind = {}));
1144
+ var MarkupContent;
1145
+ (function (MarkupContent) {
1146
+ /**
1147
+ * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.
1148
+ */
1149
+ function is(value) {
1150
+ var candidate = value;
1151
+ return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
1152
+ }
1153
+ MarkupContent.is = is;
1154
+ })(MarkupContent = exports.MarkupContent || (exports.MarkupContent = {}));
1155
+ /**
1156
+ * The kind of a completion entry.
1157
+ */
1158
+ var CompletionItemKind;
1159
+ (function (CompletionItemKind) {
1160
+ CompletionItemKind.Text = 1;
1161
+ CompletionItemKind.Method = 2;
1162
+ CompletionItemKind.Function = 3;
1163
+ CompletionItemKind.Constructor = 4;
1164
+ CompletionItemKind.Field = 5;
1165
+ CompletionItemKind.Variable = 6;
1166
+ CompletionItemKind.Class = 7;
1167
+ CompletionItemKind.Interface = 8;
1168
+ CompletionItemKind.Module = 9;
1169
+ CompletionItemKind.Property = 10;
1170
+ CompletionItemKind.Unit = 11;
1171
+ CompletionItemKind.Value = 12;
1172
+ CompletionItemKind.Enum = 13;
1173
+ CompletionItemKind.Keyword = 14;
1174
+ CompletionItemKind.Snippet = 15;
1175
+ CompletionItemKind.Color = 16;
1176
+ CompletionItemKind.File = 17;
1177
+ CompletionItemKind.Reference = 18;
1178
+ CompletionItemKind.Folder = 19;
1179
+ CompletionItemKind.EnumMember = 20;
1180
+ CompletionItemKind.Constant = 21;
1181
+ CompletionItemKind.Struct = 22;
1182
+ CompletionItemKind.Event = 23;
1183
+ CompletionItemKind.Operator = 24;
1184
+ CompletionItemKind.TypeParameter = 25;
1185
+ })(CompletionItemKind = exports.CompletionItemKind || (exports.CompletionItemKind = {}));
1186
+ /**
1187
+ * Defines whether the insert text in a completion item should be interpreted as
1188
+ * plain text or a snippet.
1189
+ */
1190
+ var InsertTextFormat;
1191
+ (function (InsertTextFormat) {
1192
+ /**
1193
+ * The primary text to be inserted is treated as a plain string.
1194
+ */
1195
+ InsertTextFormat.PlainText = 1;
1196
+ /**
1197
+ * The primary text to be inserted is treated as a snippet.
1198
+ *
1199
+ * A snippet can define tab stops and placeholders with `$1`, `$2`
1200
+ * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
1201
+ * the end of the snippet. Placeholders with equal identifiers are linked,
1202
+ * that is typing in one will update others too.
1203
+ *
1204
+ * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax
1205
+ */
1206
+ InsertTextFormat.Snippet = 2;
1207
+ })(InsertTextFormat = exports.InsertTextFormat || (exports.InsertTextFormat = {}));
1208
+ /**
1209
+ * Completion item tags are extra annotations that tweak the rendering of a completion
1210
+ * item.
1211
+ *
1212
+ * @since 3.15.0
1213
+ */
1214
+ var CompletionItemTag;
1215
+ (function (CompletionItemTag) {
1216
+ /**
1217
+ * Render a completion as obsolete, usually using a strike-out.
1218
+ */
1219
+ CompletionItemTag.Deprecated = 1;
1220
+ })(CompletionItemTag = exports.CompletionItemTag || (exports.CompletionItemTag = {}));
1221
+ /**
1222
+ * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.
1223
+ *
1224
+ * @since 3.16.0
1225
+ */
1226
+ var InsertReplaceEdit;
1227
+ (function (InsertReplaceEdit) {
1228
+ /**
1229
+ * Creates a new insert / replace edit
1230
+ */
1231
+ function create(newText, insert, replace) {
1232
+ return { newText: newText, insert: insert, replace: replace };
1233
+ }
1234
+ InsertReplaceEdit.create = create;
1235
+ /**
1236
+ * Checks whether the given literal conforms to the [InsertReplaceEdit](#InsertReplaceEdit) interface.
1237
+ */
1238
+ function is(value) {
1239
+ var candidate = value;
1240
+ return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
1241
+ }
1242
+ InsertReplaceEdit.is = is;
1243
+ })(InsertReplaceEdit = exports.InsertReplaceEdit || (exports.InsertReplaceEdit = {}));
1244
+ /**
1245
+ * How whitespace and indentation is handled during completion
1246
+ * item insertion.
1247
+ *
1248
+ * @since 3.16.0
1249
+ */
1250
+ var InsertTextMode;
1251
+ (function (InsertTextMode) {
1252
+ /**
1253
+ * The insertion or replace strings is taken as it is. If the
1254
+ * value is multi line the lines below the cursor will be
1255
+ * inserted using the indentation defined in the string value.
1256
+ * The client will not apply any kind of adjustments to the
1257
+ * string.
1258
+ */
1259
+ InsertTextMode.asIs = 1;
1260
+ /**
1261
+ * The editor adjusts leading whitespace of new lines so that
1262
+ * they match the indentation up to the cursor of the line for
1263
+ * which the item is accepted.
1264
+ *
1265
+ * Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
1266
+ * multi line completion item is indented using 2 tabs and all
1267
+ * following lines inserted will be indented using 2 tabs as well.
1268
+ */
1269
+ InsertTextMode.adjustIndentation = 2;
1270
+ })(InsertTextMode = exports.InsertTextMode || (exports.InsertTextMode = {}));
1271
+ /**
1272
+ * The CompletionItem namespace provides functions to deal with
1273
+ * completion items.
1274
+ */
1275
+ var CompletionItem;
1276
+ (function (CompletionItem) {
1277
+ /**
1278
+ * Create a completion item and seed it with a label.
1279
+ * @param label The completion item's label
1280
+ */
1281
+ function create(label) {
1282
+ return { label: label };
1283
+ }
1284
+ CompletionItem.create = create;
1285
+ })(CompletionItem = exports.CompletionItem || (exports.CompletionItem = {}));
1286
+ /**
1287
+ * The CompletionList namespace provides functions to deal with
1288
+ * completion lists.
1289
+ */
1290
+ var CompletionList;
1291
+ (function (CompletionList) {
1292
+ /**
1293
+ * Creates a new completion list.
1294
+ *
1295
+ * @param items The completion items.
1296
+ * @param isIncomplete The list is not complete.
1297
+ */
1298
+ function create(items, isIncomplete) {
1299
+ return { items: items ? items : [], isIncomplete: !!isIncomplete };
1300
+ }
1301
+ CompletionList.create = create;
1302
+ })(CompletionList = exports.CompletionList || (exports.CompletionList = {}));
1303
+ var MarkedString;
1304
+ (function (MarkedString) {
1305
+ /**
1306
+ * Creates a marked string from plain text.
1307
+ *
1308
+ * @param plainText The plain text.
1309
+ */
1310
+ function fromPlainText(plainText) {
1311
+ return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
1312
+ }
1313
+ MarkedString.fromPlainText = fromPlainText;
1314
+ /**
1315
+ * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.
1316
+ */
1317
+ function is(value) {
1318
+ var candidate = value;
1319
+ return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
1320
+ }
1321
+ MarkedString.is = is;
1322
+ })(MarkedString = exports.MarkedString || (exports.MarkedString = {}));
1323
+ var Hover;
1324
+ (function (Hover) {
1325
+ /**
1326
+ * Checks whether the given value conforms to the [Hover](#Hover) interface.
1327
+ */
1328
+ function is(value) {
1329
+ var candidate = value;
1330
+ return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
1331
+ MarkedString.is(candidate.contents) ||
1332
+ Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));
1333
+ }
1334
+ Hover.is = is;
1335
+ })(Hover = exports.Hover || (exports.Hover = {}));
1336
+ /**
1337
+ * The ParameterInformation namespace provides helper functions to work with
1338
+ * [ParameterInformation](#ParameterInformation) literals.
1339
+ */
1340
+ var ParameterInformation;
1341
+ (function (ParameterInformation) {
1342
+ /**
1343
+ * Creates a new parameter information literal.
1344
+ *
1345
+ * @param label A label string.
1346
+ * @param documentation A doc string.
1347
+ */
1348
+ function create(label, documentation) {
1349
+ return documentation ? { label: label, documentation: documentation } : { label: label };
1350
+ }
1351
+ ParameterInformation.create = create;
1352
+ })(ParameterInformation = exports.ParameterInformation || (exports.ParameterInformation = {}));
1353
+ /**
1354
+ * The SignatureInformation namespace provides helper functions to work with
1355
+ * [SignatureInformation](#SignatureInformation) literals.
1356
+ */
1357
+ var SignatureInformation;
1358
+ (function (SignatureInformation) {
1359
+ function create(label, documentation) {
1360
+ var parameters = [];
1361
+ for (var _i = 2; _i < arguments.length; _i++) {
1362
+ parameters[_i - 2] = arguments[_i];
1363
+ }
1364
+ var result = { label: label };
1365
+ if (Is.defined(documentation)) {
1366
+ result.documentation = documentation;
1367
+ }
1368
+ if (Is.defined(parameters)) {
1369
+ result.parameters = parameters;
1370
+ }
1371
+ else {
1372
+ result.parameters = [];
1373
+ }
1374
+ return result;
1375
+ }
1376
+ SignatureInformation.create = create;
1377
+ })(SignatureInformation = exports.SignatureInformation || (exports.SignatureInformation = {}));
1378
+ /**
1379
+ * A document highlight kind.
1380
+ */
1381
+ var DocumentHighlightKind;
1382
+ (function (DocumentHighlightKind) {
1383
+ /**
1384
+ * A textual occurrence.
1385
+ */
1386
+ DocumentHighlightKind.Text = 1;
1387
+ /**
1388
+ * Read-access of a symbol, like reading a variable.
1389
+ */
1390
+ DocumentHighlightKind.Read = 2;
1391
+ /**
1392
+ * Write-access of a symbol, like writing to a variable.
1393
+ */
1394
+ DocumentHighlightKind.Write = 3;
1395
+ })(DocumentHighlightKind = exports.DocumentHighlightKind || (exports.DocumentHighlightKind = {}));
1396
+ /**
1397
+ * DocumentHighlight namespace to provide helper functions to work with
1398
+ * [DocumentHighlight](#DocumentHighlight) literals.
1399
+ */
1400
+ var DocumentHighlight;
1401
+ (function (DocumentHighlight) {
1402
+ /**
1403
+ * Create a DocumentHighlight object.
1404
+ * @param range The range the highlight applies to.
1405
+ */
1406
+ function create(range, kind) {
1407
+ var result = { range: range };
1408
+ if (Is.number(kind)) {
1409
+ result.kind = kind;
1410
+ }
1411
+ return result;
1412
+ }
1413
+ DocumentHighlight.create = create;
1414
+ })(DocumentHighlight = exports.DocumentHighlight || (exports.DocumentHighlight = {}));
1415
+ /**
1416
+ * A symbol kind.
1417
+ */
1418
+ var SymbolKind;
1419
+ (function (SymbolKind) {
1420
+ SymbolKind.File = 1;
1421
+ SymbolKind.Module = 2;
1422
+ SymbolKind.Namespace = 3;
1423
+ SymbolKind.Package = 4;
1424
+ SymbolKind.Class = 5;
1425
+ SymbolKind.Method = 6;
1426
+ SymbolKind.Property = 7;
1427
+ SymbolKind.Field = 8;
1428
+ SymbolKind.Constructor = 9;
1429
+ SymbolKind.Enum = 10;
1430
+ SymbolKind.Interface = 11;
1431
+ SymbolKind.Function = 12;
1432
+ SymbolKind.Variable = 13;
1433
+ SymbolKind.Constant = 14;
1434
+ SymbolKind.String = 15;
1435
+ SymbolKind.Number = 16;
1436
+ SymbolKind.Boolean = 17;
1437
+ SymbolKind.Array = 18;
1438
+ SymbolKind.Object = 19;
1439
+ SymbolKind.Key = 20;
1440
+ SymbolKind.Null = 21;
1441
+ SymbolKind.EnumMember = 22;
1442
+ SymbolKind.Struct = 23;
1443
+ SymbolKind.Event = 24;
1444
+ SymbolKind.Operator = 25;
1445
+ SymbolKind.TypeParameter = 26;
1446
+ })(SymbolKind = exports.SymbolKind || (exports.SymbolKind = {}));
1447
+ /**
1448
+ * Symbol tags are extra annotations that tweak the rendering of a symbol.
1449
+ * @since 3.16
1450
+ */
1451
+ var SymbolTag;
1452
+ (function (SymbolTag) {
1453
+ /**
1454
+ * Render a symbol as obsolete, usually using a strike-out.
1455
+ */
1456
+ SymbolTag.Deprecated = 1;
1457
+ })(SymbolTag = exports.SymbolTag || (exports.SymbolTag = {}));
1458
+ var SymbolInformation;
1459
+ (function (SymbolInformation) {
1460
+ /**
1461
+ * Creates a new symbol information literal.
1462
+ *
1463
+ * @param name The name of the symbol.
1464
+ * @param kind The kind of the symbol.
1465
+ * @param range The range of the location of the symbol.
1466
+ * @param uri The resource of the location of symbol, defaults to the current document.
1467
+ * @param containerName The name of the symbol containing the symbol.
1468
+ */
1469
+ function create(name, kind, range, uri, containerName) {
1470
+ var result = {
1471
+ name: name,
1472
+ kind: kind,
1473
+ location: { uri: uri, range: range }
1474
+ };
1475
+ if (containerName) {
1476
+ result.containerName = containerName;
1477
+ }
1478
+ return result;
1479
+ }
1480
+ SymbolInformation.create = create;
1481
+ })(SymbolInformation = exports.SymbolInformation || (exports.SymbolInformation = {}));
1482
+ var DocumentSymbol;
1483
+ (function (DocumentSymbol) {
1484
+ /**
1485
+ * Creates a new symbol information literal.
1486
+ *
1487
+ * @param name The name of the symbol.
1488
+ * @param detail The detail of the symbol.
1489
+ * @param kind The kind of the symbol.
1490
+ * @param range The range of the symbol.
1491
+ * @param selectionRange The selectionRange of the symbol.
1492
+ * @param children Children of the symbol.
1493
+ */
1494
+ function create(name, detail, kind, range, selectionRange, children) {
1495
+ var result = {
1496
+ name: name,
1497
+ detail: detail,
1498
+ kind: kind,
1499
+ range: range,
1500
+ selectionRange: selectionRange
1501
+ };
1502
+ if (children !== undefined) {
1503
+ result.children = children;
1504
+ }
1505
+ return result;
1506
+ }
1507
+ DocumentSymbol.create = create;
1508
+ /**
1509
+ * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.
1510
+ */
1511
+ function is(value) {
1512
+ var candidate = value;
1513
+ return candidate &&
1514
+ Is.string(candidate.name) && Is.number(candidate.kind) &&
1515
+ Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
1516
+ (candidate.detail === undefined || Is.string(candidate.detail)) &&
1517
+ (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&
1518
+ (candidate.children === undefined || Array.isArray(candidate.children)) &&
1519
+ (candidate.tags === undefined || Array.isArray(candidate.tags));
1520
+ }
1521
+ DocumentSymbol.is = is;
1522
+ })(DocumentSymbol = exports.DocumentSymbol || (exports.DocumentSymbol = {}));
1523
+ /**
1524
+ * A set of predefined code action kinds
1525
+ */
1526
+ var CodeActionKind;
1527
+ (function (CodeActionKind) {
1528
+ /**
1529
+ * Empty kind.
1530
+ */
1531
+ CodeActionKind.Empty = '';
1532
+ /**
1533
+ * Base kind for quickfix actions: 'quickfix'
1534
+ */
1535
+ CodeActionKind.QuickFix = 'quickfix';
1536
+ /**
1537
+ * Base kind for refactoring actions: 'refactor'
1538
+ */
1539
+ CodeActionKind.Refactor = 'refactor';
1540
+ /**
1541
+ * Base kind for refactoring extraction actions: 'refactor.extract'
1542
+ *
1543
+ * Example extract actions:
1544
+ *
1545
+ * - Extract method
1546
+ * - Extract function
1547
+ * - Extract variable
1548
+ * - Extract interface from class
1549
+ * - ...
1550
+ */
1551
+ CodeActionKind.RefactorExtract = 'refactor.extract';
1552
+ /**
1553
+ * Base kind for refactoring inline actions: 'refactor.inline'
1554
+ *
1555
+ * Example inline actions:
1556
+ *
1557
+ * - Inline function
1558
+ * - Inline variable
1559
+ * - Inline constant
1560
+ * - ...
1561
+ */
1562
+ CodeActionKind.RefactorInline = 'refactor.inline';
1563
+ /**
1564
+ * Base kind for refactoring rewrite actions: 'refactor.rewrite'
1565
+ *
1566
+ * Example rewrite actions:
1567
+ *
1568
+ * - Convert JavaScript function to class
1569
+ * - Add or remove parameter
1570
+ * - Encapsulate field
1571
+ * - Make method static
1572
+ * - Move method to base class
1573
+ * - ...
1574
+ */
1575
+ CodeActionKind.RefactorRewrite = 'refactor.rewrite';
1576
+ /**
1577
+ * Base kind for source actions: `source`
1578
+ *
1579
+ * Source code actions apply to the entire file.
1580
+ */
1581
+ CodeActionKind.Source = 'source';
1582
+ /**
1583
+ * Base kind for an organize imports source action: `source.organizeImports`
1584
+ */
1585
+ CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
1586
+ /**
1587
+ * Base kind for auto-fix source actions: `source.fixAll`.
1588
+ *
1589
+ * Fix all actions automatically fix errors that have a clear fix that do not require user input.
1590
+ * They should not suppress errors or perform unsafe fixes such as generating new types or classes.
1591
+ *
1592
+ * @since 3.15.0
1593
+ */
1594
+ CodeActionKind.SourceFixAll = 'source.fixAll';
1595
+ })(CodeActionKind = exports.CodeActionKind || (exports.CodeActionKind = {}));
1596
+ /**
1597
+ * The CodeActionContext namespace provides helper functions to work with
1598
+ * [CodeActionContext](#CodeActionContext) literals.
1599
+ */
1600
+ var CodeActionContext;
1601
+ (function (CodeActionContext) {
1602
+ /**
1603
+ * Creates a new CodeActionContext literal.
1604
+ */
1605
+ function create(diagnostics, only) {
1606
+ var result = { diagnostics: diagnostics };
1607
+ if (only !== undefined && only !== null) {
1608
+ result.only = only;
1609
+ }
1610
+ return result;
1611
+ }
1612
+ CodeActionContext.create = create;
1613
+ /**
1614
+ * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.
1615
+ */
1616
+ function is(value) {
1617
+ var candidate = value;
1618
+ return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string));
1619
+ }
1620
+ CodeActionContext.is = is;
1621
+ })(CodeActionContext = exports.CodeActionContext || (exports.CodeActionContext = {}));
1622
+ var CodeAction;
1623
+ (function (CodeAction) {
1624
+ function create(title, kindOrCommandOrEdit, kind) {
1625
+ var result = { title: title };
1626
+ var checkKind = true;
1627
+ if (typeof kindOrCommandOrEdit === 'string') {
1628
+ checkKind = false;
1629
+ result.kind = kindOrCommandOrEdit;
1630
+ }
1631
+ else if (Command.is(kindOrCommandOrEdit)) {
1632
+ result.command = kindOrCommandOrEdit;
1633
+ }
1634
+ else {
1635
+ result.edit = kindOrCommandOrEdit;
1636
+ }
1637
+ if (checkKind && kind !== undefined) {
1638
+ result.kind = kind;
1639
+ }
1640
+ return result;
1641
+ }
1642
+ CodeAction.create = create;
1643
+ function is(value) {
1644
+ var candidate = value;
1645
+ return candidate && Is.string(candidate.title) &&
1646
+ (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
1647
+ (candidate.kind === undefined || Is.string(candidate.kind)) &&
1648
+ (candidate.edit !== undefined || candidate.command !== undefined) &&
1649
+ (candidate.command === undefined || Command.is(candidate.command)) &&
1650
+ (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&
1651
+ (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));
1652
+ }
1653
+ CodeAction.is = is;
1654
+ })(CodeAction = exports.CodeAction || (exports.CodeAction = {}));
1655
+ /**
1656
+ * The CodeLens namespace provides helper functions to work with
1657
+ * [CodeLens](#CodeLens) literals.
1658
+ */
1659
+ var CodeLens;
1660
+ (function (CodeLens) {
1661
+ /**
1662
+ * Creates a new CodeLens literal.
1663
+ */
1664
+ function create(range, data) {
1665
+ var result = { range: range };
1666
+ if (Is.defined(data)) {
1667
+ result.data = data;
1668
+ }
1669
+ return result;
1670
+ }
1671
+ CodeLens.create = create;
1672
+ /**
1673
+ * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.
1674
+ */
1675
+ function is(value) {
1676
+ var candidate = value;
1677
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
1678
+ }
1679
+ CodeLens.is = is;
1680
+ })(CodeLens = exports.CodeLens || (exports.CodeLens = {}));
1681
+ /**
1682
+ * The FormattingOptions namespace provides helper functions to work with
1683
+ * [FormattingOptions](#FormattingOptions) literals.
1684
+ */
1685
+ var FormattingOptions;
1686
+ (function (FormattingOptions) {
1687
+ /**
1688
+ * Creates a new FormattingOptions literal.
1689
+ */
1690
+ function create(tabSize, insertSpaces) {
1691
+ return { tabSize: tabSize, insertSpaces: insertSpaces };
1692
+ }
1693
+ FormattingOptions.create = create;
1694
+ /**
1695
+ * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.
1696
+ */
1697
+ function is(value) {
1698
+ var candidate = value;
1699
+ return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
1700
+ }
1701
+ FormattingOptions.is = is;
1702
+ })(FormattingOptions = exports.FormattingOptions || (exports.FormattingOptions = {}));
1703
+ /**
1704
+ * The DocumentLink namespace provides helper functions to work with
1705
+ * [DocumentLink](#DocumentLink) literals.
1706
+ */
1707
+ var DocumentLink;
1708
+ (function (DocumentLink) {
1709
+ /**
1710
+ * Creates a new DocumentLink literal.
1711
+ */
1712
+ function create(range, target, data) {
1713
+ return { range: range, target: target, data: data };
1714
+ }
1715
+ DocumentLink.create = create;
1716
+ /**
1717
+ * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.
1718
+ */
1719
+ function is(value) {
1720
+ var candidate = value;
1721
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
1722
+ }
1723
+ DocumentLink.is = is;
1724
+ })(DocumentLink = exports.DocumentLink || (exports.DocumentLink = {}));
1725
+ /**
1726
+ * The SelectionRange namespace provides helper function to work with
1727
+ * SelectionRange literals.
1728
+ */
1729
+ var SelectionRange;
1730
+ (function (SelectionRange) {
1731
+ /**
1732
+ * Creates a new SelectionRange
1733
+ * @param range the range.
1734
+ * @param parent an optional parent.
1735
+ */
1736
+ function create(range, parent) {
1737
+ return { range: range, parent: parent };
1738
+ }
1739
+ SelectionRange.create = create;
1740
+ function is(value) {
1741
+ var candidate = value;
1742
+ return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
1743
+ }
1744
+ SelectionRange.is = is;
1745
+ })(SelectionRange = exports.SelectionRange || (exports.SelectionRange = {}));
1746
+ exports.EOL = ['\n', '\r\n', '\r'];
1747
+ /**
1748
+ * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
1749
+ */
1750
+ var TextDocument;
1751
+ (function (TextDocument) {
1752
+ /**
1753
+ * Creates a new ITextDocument literal from the given uri and content.
1754
+ * @param uri The document's uri.
1755
+ * @param languageId The document's language Id.
1756
+ * @param content The document's content.
1757
+ */
1758
+ function create(uri, languageId, version, content) {
1759
+ return new FullTextDocument(uri, languageId, version, content);
1760
+ }
1761
+ TextDocument.create = create;
1762
+ /**
1763
+ * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.
1764
+ */
1765
+ function is(value) {
1766
+ var candidate = value;
1767
+ return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)
1768
+ && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
1769
+ }
1770
+ TextDocument.is = is;
1771
+ function applyEdits(document, edits) {
1772
+ var text = document.getText();
1773
+ var sortedEdits = mergeSort(edits, function (a, b) {
1774
+ var diff = a.range.start.line - b.range.start.line;
1775
+ if (diff === 0) {
1776
+ return a.range.start.character - b.range.start.character;
1777
+ }
1778
+ return diff;
1779
+ });
1780
+ var lastModifiedOffset = text.length;
1781
+ for (var i = sortedEdits.length - 1; i >= 0; i--) {
1782
+ var e = sortedEdits[i];
1783
+ var startOffset = document.offsetAt(e.range.start);
1784
+ var endOffset = document.offsetAt(e.range.end);
1785
+ if (endOffset <= lastModifiedOffset) {
1786
+ text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
1787
+ }
1788
+ else {
1789
+ throw new Error('Overlapping edit');
1790
+ }
1791
+ lastModifiedOffset = startOffset;
1792
+ }
1793
+ return text;
1794
+ }
1795
+ TextDocument.applyEdits = applyEdits;
1796
+ function mergeSort(data, compare) {
1797
+ if (data.length <= 1) {
1798
+ // sorted
1799
+ return data;
1800
+ }
1801
+ var p = (data.length / 2) | 0;
1802
+ var left = data.slice(0, p);
1803
+ var right = data.slice(p);
1804
+ mergeSort(left, compare);
1805
+ mergeSort(right, compare);
1806
+ var leftIdx = 0;
1807
+ var rightIdx = 0;
1808
+ var i = 0;
1809
+ while (leftIdx < left.length && rightIdx < right.length) {
1810
+ var ret = compare(left[leftIdx], right[rightIdx]);
1811
+ if (ret <= 0) {
1812
+ // smaller_equal -> take left to preserve order
1813
+ data[i++] = left[leftIdx++];
1814
+ }
1815
+ else {
1816
+ // greater -> take right
1817
+ data[i++] = right[rightIdx++];
1818
+ }
1819
+ }
1820
+ while (leftIdx < left.length) {
1821
+ data[i++] = left[leftIdx++];
1822
+ }
1823
+ while (rightIdx < right.length) {
1824
+ data[i++] = right[rightIdx++];
1825
+ }
1826
+ return data;
1827
+ }
1828
+ })(TextDocument = exports.TextDocument || (exports.TextDocument = {}));
1829
+ /**
1830
+ * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
1831
+ */
1832
+ var FullTextDocument = /** @class */ (function () {
1833
+ function FullTextDocument(uri, languageId, version, content) {
1834
+ this._uri = uri;
1835
+ this._languageId = languageId;
1836
+ this._version = version;
1837
+ this._content = content;
1838
+ this._lineOffsets = undefined;
1839
+ }
1840
+ Object.defineProperty(FullTextDocument.prototype, "uri", {
1841
+ get: function () {
1842
+ return this._uri;
1843
+ },
1844
+ enumerable: false,
1845
+ configurable: true
1846
+ });
1847
+ Object.defineProperty(FullTextDocument.prototype, "languageId", {
1848
+ get: function () {
1849
+ return this._languageId;
1850
+ },
1851
+ enumerable: false,
1852
+ configurable: true
1853
+ });
1854
+ Object.defineProperty(FullTextDocument.prototype, "version", {
1855
+ get: function () {
1856
+ return this._version;
1857
+ },
1858
+ enumerable: false,
1859
+ configurable: true
1860
+ });
1861
+ FullTextDocument.prototype.getText = function (range) {
1862
+ if (range) {
1863
+ var start = this.offsetAt(range.start);
1864
+ var end = this.offsetAt(range.end);
1865
+ return this._content.substring(start, end);
1866
+ }
1867
+ return this._content;
1868
+ };
1869
+ FullTextDocument.prototype.update = function (event, version) {
1870
+ this._content = event.text;
1871
+ this._version = version;
1872
+ this._lineOffsets = undefined;
1873
+ };
1874
+ FullTextDocument.prototype.getLineOffsets = function () {
1875
+ if (this._lineOffsets === undefined) {
1876
+ var lineOffsets = [];
1877
+ var text = this._content;
1878
+ var isLineStart = true;
1879
+ for (var i = 0; i < text.length; i++) {
1880
+ if (isLineStart) {
1881
+ lineOffsets.push(i);
1882
+ isLineStart = false;
1883
+ }
1884
+ var ch = text.charAt(i);
1885
+ isLineStart = (ch === '\r' || ch === '\n');
1886
+ if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
1887
+ i++;
1888
+ }
1889
+ }
1890
+ if (isLineStart && text.length > 0) {
1891
+ lineOffsets.push(text.length);
1892
+ }
1893
+ this._lineOffsets = lineOffsets;
1894
+ }
1895
+ return this._lineOffsets;
1896
+ };
1897
+ FullTextDocument.prototype.positionAt = function (offset) {
1898
+ offset = Math.max(Math.min(offset, this._content.length), 0);
1899
+ var lineOffsets = this.getLineOffsets();
1900
+ var low = 0, high = lineOffsets.length;
1901
+ if (high === 0) {
1902
+ return Position.create(0, offset);
1903
+ }
1904
+ while (low < high) {
1905
+ var mid = Math.floor((low + high) / 2);
1906
+ if (lineOffsets[mid] > offset) {
1907
+ high = mid;
1908
+ }
1909
+ else {
1910
+ low = mid + 1;
1911
+ }
1912
+ }
1913
+ // low is the least x for which the line offset is larger than the current offset
1914
+ // or array.length if no line offset is larger than the current offset
1915
+ var line = low - 1;
1916
+ return Position.create(line, offset - lineOffsets[line]);
1917
+ };
1918
+ FullTextDocument.prototype.offsetAt = function (position) {
1919
+ var lineOffsets = this.getLineOffsets();
1920
+ if (position.line >= lineOffsets.length) {
1921
+ return this._content.length;
1922
+ }
1923
+ else if (position.line < 0) {
1924
+ return 0;
1925
+ }
1926
+ var lineOffset = lineOffsets[position.line];
1927
+ var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
1928
+ return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
1929
+ };
1930
+ Object.defineProperty(FullTextDocument.prototype, "lineCount", {
1931
+ get: function () {
1932
+ return this.getLineOffsets().length;
1933
+ },
1934
+ enumerable: false,
1935
+ configurable: true
1936
+ });
1937
+ return FullTextDocument;
1938
+ }());
1939
+ var Is;
1940
+ (function (Is) {
1941
+ var toString = Object.prototype.toString;
1942
+ function defined(value) {
1943
+ return typeof value !== 'undefined';
1944
+ }
1945
+ Is.defined = defined;
1946
+ function undefined(value) {
1947
+ return typeof value === 'undefined';
1948
+ }
1949
+ Is.undefined = undefined;
1950
+ function boolean(value) {
1951
+ return value === true || value === false;
1952
+ }
1953
+ Is.boolean = boolean;
1954
+ function string(value) {
1955
+ return toString.call(value) === '[object String]';
1956
+ }
1957
+ Is.string = string;
1958
+ function number(value) {
1959
+ return toString.call(value) === '[object Number]';
1960
+ }
1961
+ Is.number = number;
1962
+ function numberRange(value, min, max) {
1963
+ return toString.call(value) === '[object Number]' && min <= value && value <= max;
1964
+ }
1965
+ Is.numberRange = numberRange;
1966
+ function integer(value) {
1967
+ return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;
1968
+ }
1969
+ Is.integer = integer;
1970
+ function uinteger(value) {
1971
+ return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;
1972
+ }
1973
+ Is.uinteger = uinteger;
1974
+ function func(value) {
1975
+ return toString.call(value) === '[object Function]';
1976
+ }
1977
+ Is.func = func;
1978
+ function objectLiteral(value) {
1979
+ // Strictly speaking class instances pass this check as well. Since the LSP
1980
+ // doesn't use classes we ignore this for now. If we do we need to add something
1981
+ // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
1982
+ return value !== null && typeof value === 'object';
1983
+ }
1984
+ Is.objectLiteral = objectLiteral;
1985
+ function typedArray(value, check) {
1986
+ return Array.isArray(value) && value.every(check);
1987
+ }
1988
+ Is.typedArray = typedArray;
1989
+ })(Is || (Is = {}));
1990
+ });
1991
+ //# sourceMappingURL=main.js.map;
1610
1992
  define('vscode-languageserver-types', ['vscode-languageserver-types/main'], function (main) { return main; });
1611
1993
 
1612
1994
  (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define('xregexp/xregexp-all',[],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.XRegExp = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
@@ -6358,7 +6740,6 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
6358
6740
  kind: classification.Kind,
6359
6741
  }); });
6360
6742
  }
6361
- ;
6362
6743
  /**
6363
6744
  * Kusto Language service translates the kusto object model (transpiled from C# by Bridge.Net)
6364
6745
  * to the vscode language server types, which are used by vscode language extensions.
@@ -6515,7 +6896,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
6515
6896
  this.__kustoJsSchemaV2 = this.convertToKustoJsSchemaV2(schema);
6516
6897
  this._schema = schema;
6517
6898
  this._clustersSetInGlobalState = new Set();
6518
- this._nonEmptyDatabaseSetInGlobalState = new Set(); // used to remove clusters that are already in the global state
6899
+ this._nonEmptyDatabaseSetInGlobalState = new Set(); // used to remove clusters that are already in the global state
6519
6900
  this.configure(languageSettings);
6520
6901
  this._newlineAppendPipePolicy = new Kusto.Data.IntelliSense.ApplyPolicy();
6521
6902
  this._newlineAppendPipePolicy.Text = '\n| ';
@@ -6537,13 +6918,14 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
6537
6918
  this.__kustoJsSchemaV2 = globalState;
6538
6919
  this._clustersSetInGlobalState.clear();
6539
6920
  this._nonEmptyDatabaseSetInGlobalState.clear();
6540
- // create 2 Sets with cluster names and database names based on the updated Global State.
6921
+ // create 2 Sets with cluster names and database names based on the updated Global State.
6541
6922
  for (var i = 0; i < globalState.Clusters.Count; i++) {
6542
6923
  var clusterSymbol = this._kustoJsSchemaV2.Clusters.getItem(i);
6543
6924
  this._clustersSetInGlobalState.add(clusterSymbol.Name);
6544
6925
  for (var i2 = 0; i2 < clusterSymbol.Databases.Count; i2++) {
6545
6926
  var databaseSymbol = clusterSymbol.Databases.getItem(i2);
6546
- if (databaseSymbol.Tables.Count > 0) { // only include database with tables
6927
+ if (databaseSymbol.Tables.Count > 0) {
6928
+ // only include database with tables
6547
6929
  this._nonEmptyDatabaseSetInGlobalState.add(this.createDatabaseUniqueName(clusterSymbol.Name, databaseSymbol.Name));
6548
6930
  }
6549
6931
  }
@@ -6634,6 +7016,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
6634
7016
  var endPosition = document.positionAt(completionItems.EditStart + completionItems.EditLength);
6635
7017
  lsItem.textEdit = ls.TextEdit.replace(ls.Range.create(startPosition, endPosition), textToInsert);
6636
7018
  lsItem.sortText = _this.getSortText(i + 1);
7019
+ // lsItem.filterText = lsItem.sortText;
6637
7020
  lsItem.kind = _this.kustoKindToLsKindV2(kItem.Kind);
6638
7021
  lsItem.insertTextFormat = format;
6639
7022
  lsItem.detail = helpTopic ? helpTopic.ShortDescription : undefined;
@@ -6773,7 +7156,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
6773
7156
  return Promise.resolve([]);
6774
7157
  }
6775
7158
  var newClustersReferences = [];
6776
- var newClustersReferencesSet = new Set(); // used to remove duplicates
7159
+ var newClustersReferencesSet = new Set(); // used to remove duplicates
6777
7160
  // Keep only unique clusters that aren't already exist in the Global State
6778
7161
  for (var i = 0; i < clusterReferences.Count; i++) {
6779
7162
  var clusterReference = clusterReferences.getItem(i);
@@ -6783,7 +7166,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
6783
7166
  continue;
6784
7167
  }
6785
7168
  newClustersReferencesSet.add(clusterHostName);
6786
- // ignore references that are already in the GlobalState.
7169
+ // ignore references that are already in the GlobalState.
6787
7170
  if (!this._clustersSetInGlobalState.has(clusterHostName)) {
6788
7171
  newClustersReferences.push({ clusterName: clusterHostName });
6789
7172
  }
@@ -6814,7 +7197,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
6814
7197
  if (!foundInGlobalState) {
6815
7198
  newDatabasesReferences.push({
6816
7199
  databaseName: databaseReference.Database,
6817
- clusterName: databaseReference.Cluster
7200
+ clusterName: databaseReference.Cluster,
6818
7201
  });
6819
7202
  }
6820
7203
  }
@@ -6973,8 +7356,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
6973
7356
  });
6974
7357
  }
6975
7358
  if (!cluster) {
6976
- var databaseSymbols = databaseNames
6977
- .map(function (databaseName) {
7359
+ var databaseSymbols = databaseNames.map(function (databaseName) {
6978
7360
  var symbol = new sym.DatabaseSymbol.$ctor1(databaseName, undefined, false);
6979
7361
  return symbol;
6980
7362
  });
@@ -7050,16 +7432,18 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
7050
7432
  name: Name,
7051
7433
  minorVersion: MinorVersion,
7052
7434
  majorVersion: MajorVersion,
7053
- tables: [].concat.apply([], [[Tables, 'Table'], [MaterializedViews, 'MaterializedView'], [ExternalTables, 'ExternalTable']]
7435
+ tables: [].concat.apply([], [
7436
+ [Tables, 'Table'],
7437
+ [MaterializedViews, 'MaterializedView'],
7438
+ [ExternalTables, 'ExternalTable'],
7439
+ ]
7054
7440
  .filter(function (_a) {
7055
7441
  var tableContainer = _a[0];
7056
7442
  return tableContainer;
7057
7443
  })
7058
7444
  .map(function (_a) {
7059
7445
  var tableContainer = _a[0], tableEntity = _a[1];
7060
- return Object
7061
- .values(tableContainer)
7062
- .map(function (_a) {
7446
+ return Object.values(tableContainer).map(function (_a) {
7063
7447
  var Name = _a.Name, OrderedColumns = _a.OrderedColumns, DocString = _a.DocString;
7064
7448
  return ({
7065
7449
  name: Name,